clear version field in rerelease

This commit is contained in:
Girish Ramakrishnan
2015-10-09 13:10:52 -07:00
parent c453df55d6
commit 8a77242072

View File

@@ -232,6 +232,10 @@ function createRelease(options) {
}
var newVersion = options.amend ? lastVersion : (options.version || semver.inc(lastVersion, 'patch'));
// guard against options.version being commander's version function. any command using this code path needs to explicitly clear the version
// this is the price to pay for using --version with commander
assert(semver.valid(newVersion));
releases[lastReachableVersion].next = newVersion;
var newImageId = options.image ? parseInt(options.image, 10) : releases[lastReachableVersion].imageId;
@@ -612,6 +616,7 @@ program.command('publish')
program.command('rerelease')
.option('--env <dev/staging/prod>', 'Environment (dev/staging/prod)', 'dev')
.option('--version <version>', 'Create the specified version', null)
.description('Make a new release, same as the last release')
.action(function (options) { options.rerelease = true; createRelease(options); });