9 changed files with 45 additions and 19 deletions
-
6package.json
-
1src/app.vue
-
4src/components/home/HomeSetting.vue
-
1src/env.d.ts
-
2src/layouts/default.vue
-
12src/router/routes.ts
-
14src/views/home/index.vue
-
17update-device.js
-
7vite.config.ts
@ -0,0 +1,17 @@ |
|||||
|
import fs from 'node:fs' |
||||
|
import path, { dirname } from 'node:path' |
||||
|
import { fileURLToPath } from 'node:url' |
||||
|
|
||||
|
const __filename = fileURLToPath(import.meta.url) |
||||
|
const __dirname = dirname(__filename) |
||||
|
|
||||
|
const packagePath = path.resolve(__dirname, 'package.json') |
||||
|
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')) |
||||
|
|
||||
|
// 读取命令行参数(默认使用 'DT300W')
|
||||
|
// eslint-disable-next-line node/prefer-global/process
|
||||
|
const deviceType = process.argv[2] || 'DT300W' |
||||
|
|
||||
|
packageJson.device = deviceType |
||||
|
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)) |
||||
|
console.log(`Version updated to: ${deviceType}`) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue