Skip to content

Commit

Permalink
workflow: allow release to local registry for testing purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Jul 2, 2019
1 parent 867c6ea commit 2d63503
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/release.js
Expand Up @@ -36,9 +36,18 @@ process.env.VUE_CLI_RELEASE = true
const execa = require('execa')
const semver = require('semver')
const inquirer = require('inquirer')
const minimist = require('minimist')
const { syncDeps } = require('./syncDeps')
// const { buildEditorConfig } = require('./buildEditorConfig')

const cliOptions = minimist(process.argv)
if (cliOptions['local-registry']) {
inquirer.prompt = () => ({
bump: 'minor',
yes: true
})
}

const curVersion = require('../lerna.json').version

const release = async () => {
Expand Down Expand Up @@ -96,7 +105,7 @@ const release = async () => {
const releaseType = semver.diff(curVersion, version)

let distTag = 'latest'
if (releaseType.startsWith('pre')) {
if (releaseType.startsWith('pre') && !cliOptions['local-registry']) {
distTag = 'next'
}

Expand All @@ -111,6 +120,10 @@ const release = async () => {
lernaArgs.push('--force-publish')
}

if (cliOptions['local-registry']) {
lernaArgs.push('--no-git-tag-version', '--no-commit-hooks', '--no-push', '--yes')
}

await execa(require.resolve('lerna/cli'), lernaArgs, { stdio: 'inherit' })
}

Expand Down

0 comments on commit 2d63503

Please sign in to comment.