Skip to content

Commit

Permalink
If the version number starts with v, delete the v and keep only the n…
Browse files Browse the repository at this point in the history
…umber part.
  • Loading branch information
zhengyangliu committed Jun 19, 2024
1 parent af586a3 commit 6233dfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions script/bin/gen-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ if (version) {
const originConfig = JSON.parse(fs.readFileSync(path.resolve(workDir, 'config.json'), 'utf8'));

originConfig.version = version;
if (version.startsWith('v') || version.startsWith('V')) {
originConfig.version = originConfig.version.slice(1);
}

fs.writeFileSync(path.resolve(workDir, 'config.json'), JSON.stringify(originConfig, null, 4));
console.log(`Config file is created: ${path.resolve(workDir, 'config.json')}`);
Expand Down

0 comments on commit 6233dfa

Please sign in to comment.