chore: add option to return next version from prepare-release (#14212)

* chore: add option to return next version from prepare-release

* shuffle logic
This commit is contained in:
Shelley Vohr 2018-08-20 08:17:47 -07:00 committed by GitHub
parent 899dd03aa1
commit 8f5923f9bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,9 @@ const gitDir = path.resolve(__dirname, '..')
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
async function getNewVersion (dryRun) {
if (!dryRun) {
console.log(`Bumping for new "${versionType}" version.`)
}
let bumpScript = path.join(__dirname, 'bump-version.py')
let scriptArgs = [bumpScript, '--bump', versionType]
if (args.stable) {
@ -261,12 +263,11 @@ async function prepareRelease (isBeta, notesOnly) {
console.log(`${fail} Automatic release is only supported for beta and nightly releases`)
process.exit(1)
}
let currentBranch
if (args.branch) {
currentBranch = args.branch
if (args.dryRun) {
let newVersion = await getNewVersion(true)
console.log(newVersion)
} else {
currentBranch = await getCurrentBranch(gitDir)
}
const currentBranch = (args.branch) ? args.branch : await getCurrentBranch(gitDir)
if (notesOnly) {
let releaseNotes = await getReleaseNotes(currentBranch)
console.log(`Draft release notes are: \n${releaseNotes}`)
@ -283,5 +284,6 @@ async function prepareRelease (isBeta, notesOnly) {
}
}
}
}
prepareRelease(!args.stable, args.notesOnly)