Mythus/Staging
0
1const fs = require('fs')2const { execSync } = require('child_process')3 4const root = fs.readFileSync('./package.json', 'utf-8')5const rootObj = JSON.parse(root)6rootObj.version = process.argv[2]7fs.writeFileSync('./package.json', JSON.stringify(rootObj, null, 2))8 9const api = fs.readFileSync('./api/package.json', 'utf-8')10const apiObj = JSON.parse(api)11apiObj.version = process.argv[2]12fs.writeFileSync('./api/package.json', JSON.stringify(apiObj, null, 2))13// execSync('cd ./server && yarn install && cd ..')14 15const web = fs.readFileSync('./web/package.json', 'utf-8')16const webObj = JSON.parse(web)17webObj.version = process.argv[2]18fs.writeFileSync('./web/package.json', JSON.stringify(webObj, null, 2))19// execSync('cd ./web && yarn install && cd ..')20 21const webVersion = fs.readFileSync('./web/src/utils/Constant.ts', 'utf-8')22fs.writeFileSync('./web/src/utils/Constant.ts', webVersion.replace(/export const VERSION \= \'.*\'/, `export const VERSION = '${process.argv[2]}'`))23 24execSync('yarn install && yarn workspaces run build')25execSync(`git add . && git commit -m "${process.argv[2]}"`)