mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
打包库时自动更新版本号
This commit is contained in:
11
web/scripts/updateVersion.js
Normal file
11
web/scripts/updateVersion.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const pkg = require('../../simple-mind-map/package.json')
|
||||
|
||||
const file = path.resolve('../simple-mind-map/full.js')
|
||||
let content = fs.readFileSync(file, 'utf-8')
|
||||
content = content.replace(
|
||||
/(MindMap.version\s*=\s*)[^\n]+(\n)/,
|
||||
`$1'${pkg.version}'$2`
|
||||
)
|
||||
fs.writeFileSync(file, content)
|
||||
Reference in New Issue
Block a user