mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
21 lines
557 B
TypeScript
21 lines
557 B
TypeScript
import childProcess from 'child_process'
|
|
import util from 'util'
|
|
import fs from 'fs'
|
|
|
|
(async () => {
|
|
const [manifest, commit]: [object & { commit: string }, string] = await Promise.all([
|
|
util
|
|
.promisify(fs.readFile)('./public/app/manifest.json', 'utf8')
|
|
.then(JSON.parse),
|
|
util
|
|
.promisify(childProcess.exec)('git log --pretty=%H -1')
|
|
.then(value => value.stdout.trim()),
|
|
])
|
|
|
|
manifest.commit = commit
|
|
await util.promisify(fs.writeFile)(
|
|
'./public/app/manifest.json',
|
|
JSON.stringify(manifest, null, 2)
|
|
)
|
|
})()
|