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 6db3d44 commit 7d52231
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/scripts/increment-version.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
async function getCurrentVersion() {
const path = await import('path');
const packageJsonPath = path.join(__dirname, `../projects/frontegg-app/package.json`);
const pkg = await import(packageJsonPath);
const pkg = await import('../projects/frontegg-app/package.json');
const [major = 0, minor = 0, patch = 0] = pkg.version.split('.').map(Number);
return { major, minor, patch };
}

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 = await import('../projects/frontegg-app/package.json');
pkg.version = `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`;
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2), { encoding: 'utf8' });
}
Expand Down

0 comments on commit 7d52231

Please sign in to comment.