mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
.github
docs
script
checkVersion.cjs
copy-core.cjs
gen-version.ts
napcat-custom.bat
napcat-gc.ps1
napcat-log.ps1
napcat-utf8.bat
napcat-utf8.ps1
napcat.bat
napcat.ps1
napcat.sh
src
static
test
.editorconfig
.env.development
.env.production
.eslintrc.cjs
.gitignore
.gitmodules
LICENSE
README.md
logo.png
package.json
tsconfig.json
vite.config.ts
22 lines
546 B
TypeScript
22 lines
546 B
TypeScript
import fs from 'fs'
|
|
import path from 'path'
|
|
import { version } from '../src/onebot11/version'
|
|
|
|
const manifestPath = path.join(__dirname, '../package.json')
|
|
|
|
function readManifest (): any {
|
|
if (fs.existsSync(manifestPath)) {
|
|
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
|
|
}
|
|
}
|
|
|
|
function writeManifest (manifest: any) {
|
|
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
|
|
}
|
|
|
|
const manifest = readManifest()
|
|
if (version !== manifest.version) {
|
|
manifest.version = version
|
|
writeManifest(manifest)
|
|
}
|