chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:44:08 +08:00
commit 983960e2dd
1244 changed files with 281996 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import fs from 'node:fs'
import { LogHelper } from '@/helpers/log-helper'
/**
* Update version number in files which need version number
*/
export default (version) =>
new Promise(async (resolve, reject) => {
LogHelper.info('Updating version...')
try {
const packageJSONPath = 'package.json'
const packageJSON = JSON.parse(
await fs.promises.readFile(packageJSONPath, 'utf8')
)
packageJSON.version = version
await fs.promises.writeFile(
packageJSONPath,
`${JSON.stringify(packageJSON, null, 2)}\n`
)
LogHelper.success(`Version updated to ${version}`)
resolve()
} catch (e) {
LogHelper.error(`Error while updating version: ${e}`)
reject(e)
}
})