mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
style: 移除多个文件末尾的空行并格式化代码
refactor(ci): 统一字符串引号风格为单引号 refactor(color): 简化数组返回语法 docs: 调整文档中的代码注释格式 chore: 添加.gitattributes文件配置行尾符
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const version = String(process.argv[2] || '').trim().replace(/^v/i, '')
|
||||
const version = String(process.argv[2] || '')
|
||||
.trim()
|
||||
.replace(/^v/i, '')
|
||||
if (!version) {
|
||||
process.stderr.write('缺少版本号参数,例如:node scripts/ci/apply-version.mjs 1.2.3\n')
|
||||
process.exit(1)
|
||||
@@ -17,4 +19,3 @@ const pkgPath = path.join(process.cwd(), 'package.json')
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
||||
pkg.version = version
|
||||
fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, 'utf-8')
|
||||
|
||||
|
||||
@@ -88,4 +88,3 @@ if (process.env.GITHUB_OUTPUT) {
|
||||
} else {
|
||||
process.stdout.write(`${JSON.stringify(outputs, null, 2)}\n`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user