Browse Source

fix: 设备脚本

master
guoapeng 2 weeks ago
parent
commit
6a5ab03372
  1. 3
      increment-version.js

3
increment-version.js

@ -2,6 +2,7 @@ import { execSync } from 'node:child_process' // 引入 child_process 模块用
import fs from 'node:fs' import fs from 'node:fs'
import path, { dirname } from 'node:path' import path, { dirname } from 'node:path'
import { fileURLToPath } from 'node:url' import { fileURLToPath } from 'node:url'
import semver from 'semver' import semver from 'semver'
const __filename = fileURLToPath(import.meta.url) const __filename = fileURLToPath(import.meta.url)
@ -22,7 +23,7 @@ if (!newVersion) {
packageJson.version = newVersion packageJson.version = newVersion
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)) fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2))
console.log(`Version updated to: ${newVersion}`)
console.log(`deviceType updated to: ${newVersion}`)
// 新增:自动提交 package.json 到远程仓库 // 新增:自动提交 package.json 到远程仓库
try { try {

Loading…
Cancel
Save