Skip to content

Commit

Permalink
fix(cli): fix release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Dec 30, 2021
1 parent 0243bd9 commit 5341cfc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/varlet-cli/src/commands/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ async function isWorktreeEmpty() {
return !ret.stdout
}

async function publish() {
async function publish(preRelease: boolean) {
const s = ora().start('Publishing all packages')
const ret = await execa('pnpm', ['-r', 'publish', '--no-git-checks', '--access', 'public'])
const args = ['-r', 'publish', '--no-git-checks', '--access', 'public']

preRelease && args.push('--tag', 'alpha')
const ret = await execa('pnpm', args)
s.succeed('Publish all packages successfully')
ret.stdout && logger.info(ret.stdout)
}
Expand Down Expand Up @@ -104,7 +107,7 @@ export async function release() {
await pushGit(expectVersion, `v${expectVersion}`)
}

await publish()
await publish(isPreRelease)

if (isPreRelease) {
packageJsonMaps.forEach(({ file, content }) => writeFileSync(file, content))
Expand Down

0 comments on commit 5341cfc

Please sign in to comment.