mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +00:00
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)
|
||
|
}
|