From 9afff7904556115afaaecf98d9d2559303d97a40 Mon Sep 17 00:00:00 2001 From: Stanley Stuart Date: Sat, 17 Apr 2021 16:38:12 -0700 Subject: [PATCH] build: update update_channel script --- .circleci/config.yml | 4 ++-- scripts/utils/_update_channel.js | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5272579613..8fb63edb5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/scripts/utils/_update_channel.js b/scripts/utils/_update_channel.js index 87775022b8..8c1baf2e51 100644 --- a/scripts/utils/_update_channel.js +++ b/scripts/utils/_update_channel.js @@ -1,7 +1,10 @@ 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') { @@ -9,5 +12,5 @@ module.exports = async () => { } else { pjson.version = pjson.version.split('-')[0] + '-dev' } - await qq.writeJSON('./package.json', pjson) + fs.writeFileSync(pjsonPath, JSON.stringify(pjson, null, 2), {encoding: 'utf8'}) }