From 6233dfaf6b6b7ee147b265a032b397efe8f1b205 Mon Sep 17 00:00:00 2001 From: ArthurZheng <869705086@qq.com> Date: Wed, 19 Jun 2024 10:57:13 +0800 Subject: [PATCH] If the version number starts with v, delete the v and keep only the number part. --- script/bin/gen-config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/bin/gen-config.js b/script/bin/gen-config.js index c2fd86f..0c88336 100644 --- a/script/bin/gen-config.js +++ b/script/bin/gen-config.js @@ -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')}`);