mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
feat(构建): 添加生成关于页面内容的脚本并更新构建流程
添加 generate-about-content.mjs 脚本用于从 README.md 生成关于页面内容 修改构建命令在 vite 构建前执行生成脚本 更新版本号同步逻辑以包含 tauri 配置和 Cargo.toml 在设置页面新增关于内容展示功能
This commit is contained in:
@@ -70,3 +70,13 @@ 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")
|
||||
|
||||
const tauriConfPath = path.join(process.cwd(), "src-tauri", "tauri.conf.json")
|
||||
const tauriConf = JSON.parse(fs.readFileSync(tauriConfPath, "utf-8"))
|
||||
tauriConf.version = version
|
||||
fs.writeFileSync(tauriConfPath, `${JSON.stringify(tauriConf, null, 2)}\n`, "utf-8")
|
||||
|
||||
const cargoPath = path.join(process.cwd(), "src-tauri", "Cargo.toml")
|
||||
let cargoContent = fs.readFileSync(cargoPath, "utf-8")
|
||||
cargoContent = cargoContent.replace(/^version = "[^"]+"/m, `version = "${version}"`)
|
||||
fs.writeFileSync(cargoPath, cargoContent, "utf-8")
|
||||
|
||||
Reference in New Issue
Block a user