Skip to content

Commit

Permalink
build: update update_channel script
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetanley committed Apr 17, 2021
1 parent 26ba461 commit 9afff79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ jobs:
yarn --frozen-lockfile
- run:
name: Building Windows binaries
command: ./scripts/pack/win
command: ./scripts/pack/win && mv packages/cli/dist /build/dist
- persist_to_workspace:
root: /cli/packages/cli
root: /build
paths:
- dist
pack-tarballs:
Expand Down
9 changes: 6 additions & 3 deletions scripts/utils/_update_channel.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const qq = require('qqjs')
const fs = require('fs')
const path = require('path')

module.exports = async () => {
const pjson = await qq.readJSON('./package.json')
module.exports = () => {
const pjsonPath = path.join(__dirname, '..', '..', 'packages', 'cli', 'package.json')
const pjson = require(pjsonPath)
if (process.env.CIRCLE_TAG && process.env.CIRCLE_TAG.startsWith('v')) {
pjson.version = pjson.version.split('-')[0]
} else if (process.env.CIRCLE_BRANCH === 'master') {
pjson.version = pjson.version.split('-')[0] + '-beta'
} else {
pjson.version = pjson.version.split('-')[0] + '-dev'
}
await qq.writeJSON('./package.json', pjson)
fs.writeFileSync(pjsonPath, JSON.stringify(pjson, null, 2), {encoding: 'utf8'})
}

0 comments on commit 9afff79

Please sign in to comment.