From 11a389c8f99c9cbe376fa72722381c698e41f889 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 29 Nov 2021 18:05:43 +0100 Subject: [PATCH] chore: have correct version in driver (#10374) --- utils/build/update_canary_version.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/build/update_canary_version.js b/utils/build/update_canary_version.js index 43004e8c70..892da77c29 100755 --- a/utils/build/update_canary_version.js +++ b/utils/build/update_canary_version.js @@ -31,19 +31,20 @@ if (process.argv[2] === '--alpha') { throw new Error('only --alpha or --beta prefixes are allowed'); } +let newVersion; if (process.argv[3] === '--today-date') { const date = new Date(); const month = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'][date.getMonth()]; const day = date.getDate(); const year = date.getFullYear(); - packageJSON.version = `${baseVersion}-${prefix}-${month}-${day}-${year}`; + newVersion = `${baseVersion}-${prefix}-${month}-${day}-${year}`; } else if (process.argv[3] === '--commit-timestamp') { const timestamp = execSync('git show -s --format=%ct HEAD', { stdio: ['ignore', 'pipe', 'ignore'] }).toString('utf8').trim(); - packageJSON.version = `${baseVersion}-${prefix}-${timestamp}000`; + newVersion = `${baseVersion}-${prefix}-${timestamp}000`; } else { throw new Error('This script must be run with either --commit-timestamp or --today-date parameter'); } -console.log('Setting version to ' + packageJSON.version); -fs.writeFileSync(path.join(__dirname, '..', '..', 'package.json'), JSON.stringify(packageJSON, undefined, 2) + '\n'); +console.log('Setting version to ' + newVersion); +execSync(`node utils/bump_package_versions.js ${newVersion}`, { stdio: 'inherit' });