Skip to content

Commit

Permalink
fix improts
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerFrontegg committed Nov 5, 2024
1 parent 283072b commit 835e9af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/increment-version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
async function getCurrentVersion() {
const pkg = await import('../../projects/frontegg-app/package.json');
const { path } = await import('path');
const packageJsonPath = path.join(__dirname, `../projects/frontegg-app/package.json`);
const pkg = await import(packageJsonPath);
const [major = 0, minor = 0, patch = 0] = pkg.version.split('.').map(Number);
return { major, minor, patch };
}
Expand All @@ -8,8 +10,8 @@ async function modifyVersion(newVersion) {
const { writeFileSync } = await import('fs');
const { path } = await import('path');
const packageJsonPath = path.join(__dirname, `../projects/frontegg-app/package.json`);
const pkg = await import(packageJsonPath);
console.log('Modifying package.json', packageJsonPath);
const pkg = require(packageJsonPath);
pkg.version = `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`;
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2), { encoding: 'utf8' });
}
Expand Down

0 comments on commit 835e9af

Please sign in to comment.