forked from mgilangjanuar/teledrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade.js
22 lines (18 loc) · 877 Bytes
/
upgrade.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const fs = require('fs')
const { execSync } = require('child_process')
const root = fs.readFileSync('./package.json', 'utf-8')
const rootObj = JSON.parse(root)
rootObj.version = process.argv[2]
fs.writeFileSync('./package.json', JSON.stringify(rootObj, null, 2))
const api = fs.readFileSync('./server/package.json', 'utf-8')
const apiObj = JSON.parse(api)
apiObj.version = process.argv[2]
fs.writeFileSync('./server/package.json', JSON.stringify(apiObj, null, 2))
// execSync('cd ./server && yarn install && cd ..')
const web = fs.readFileSync('./web/package.json', 'utf-8')
const webObj = JSON.parse(web)
webObj.version = process.argv[2]
fs.writeFileSync('./web/package.json', JSON.stringify(webObj, null, 2))
// execSync('cd ./web && yarn install && cd ..')
execSync('yarn install && yarn workspaces run build')
execSync(`git add . && git commit -m "${process.argv[2]}"`)