Skip to content

Commit 19ee1e5

Browse files
committed
fix(tools/version): 令 src/version.ts 文件的更新兼容正式版本之外的版本
避免出现如下面这样的问题: 1. 当前版本 0.10.3-alpha.3-lazyassert 2. 跑 `npm run version` 3. src/version 里 export 出来的值变为 '0.10.3-alpha.3-lazyassert-alpha0.10.3-alpha.3-lazyassert-lazyassert'
1 parent 5e9ef07 commit 19ee1e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ const version = require('../package.json').version
44

55
const filePath = 'src/version.ts'
66

7-
const replace = fs.readFileSync(filePath, 'utf-8').replace(/[\d\.]+/g, `${version}`)
7+
const replace = fs.readFileSync(filePath, 'utf-8').replace(/'.*'/g, `'${version}'`)
88

99
fs.writeFileSync(filePath, replace)

0 commit comments

Comments
 (0)