mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
改×2
This commit is contained in:
@@ -9,12 +9,6 @@ if (!version) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const semverRe = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/
|
|
||||||
if (!semverRe.test(version)) {
|
|
||||||
process.stderr.write(`非法版本号:${version}\n`)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
const pkgPath = path.join(process.cwd(), 'package.json')
|
const pkgPath = path.join(process.cwd(), 'package.json')
|
||||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
||||||
pkg.version = version
|
pkg.version = version
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const message = String(rawMessage || '').trim()
|
|||||||
// 是否以 release: 开头
|
// 是否以 release: 开头
|
||||||
const isReleasePrefix = /^release:/i.test(message)
|
const isReleasePrefix = /^release:/i.test(message)
|
||||||
|
|
||||||
const semverRe = /\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\b/
|
const semverRe = /\bv?(\S+)/
|
||||||
const versionMatch = message.match(semverRe)
|
const versionMatch = message.match(semverRe)
|
||||||
const version = versionMatch ? versionMatch[1] : ''
|
const version = versionMatch ? versionMatch[1] : ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user