Build: Implemented theatre.update-versions script
This commit is contained in:
parent
2342e83d49
commit
dfcd2814ae
4 changed files with 27 additions and 5 deletions
19
theatre/devEnv/updateVersions.ts
Normal file
19
theatre/devEnv/updateVersions.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import {writeFileSync} from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const theatreDir = path.join(__dirname, '..')
|
||||
const version = require('../package.json').version
|
||||
|
||||
for (const which of ['core', 'studio']) {
|
||||
const original = require('../' + which + '/package.json')
|
||||
if (original.version !== version) {
|
||||
console.log(`Setting version of @theatre/${which} to ${version}`)
|
||||
|
||||
const newJson = {...original}
|
||||
newJson.version = version
|
||||
writeFileSync(
|
||||
path.join(theatreDir, `./${which}/package.json`),
|
||||
JSON.stringify(newJson, undefined, 2),
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue