Skip to content

Commit

Permalink
[Version bump check] Change name of package constant (#1301)
Browse files Browse the repository at this point in the history
Switching to ECMAScript modules also triggers strict mode, and `package` is
apparently a reserved word in strict mode.
  • Loading branch information
tidoust authored Jul 25, 2024
1 parent 1583463 commit 6ad0e06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/bump-packages-minor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const scriptPath = path.dirname(fileURLToPath(import.meta.url));
async function checkPackage(type) {
console.log(`Check ${type} package`);
const packageFile = path.resolve(scriptPath, '..', 'packages', type, 'package.json');
const package = await loadJSON(packageFile);
const version = package.version;
const packageContents = await loadJSON(packageFile);
const version = packageContents.version;
console.log(`- Current version: ${version}`);

// Loosely adapted from semver:
Expand All @@ -47,8 +47,8 @@ async function checkPackage(type) {
if (res) {
console.log('- new/deleted files found');
const newVersion = `${major}.${minor+1}.0`;
package.version = newVersion;
fs.writeFile(packageFile, JSON.stringify(package, null, 2), 'utf8');
packageContents.version = newVersion;
fs.writeFile(packageFile, JSON.stringify(packageContents, null, 2), 'utf8');
console.log(`- Version bumped to ${newVersion}`);
}
else {
Expand Down

0 comments on commit 6ad0e06

Please sign in to comment.