From 37a264758ae1703e8e10196649929b59c416061b Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Mon, 5 Jun 2017 17:11:49 -0700 Subject: [PATCH] fix: populating --new-version interferes with some commands, like git, better that someone pull this value from package.json --- lib/lifecycles/bump.js | 4 ++-- lib/lifecycles/changelog.js | 4 ++-- lib/lifecycles/commit.js | 4 ++-- lib/lifecycles/tag.js | 4 ++-- lib/run-lifecycle-script.js | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/lifecycles/bump.js b/lib/lifecycles/bump.js index bb75af268..2508b69a8 100644 --- a/lib/lifecycles/bump.js +++ b/lib/lifecycles/bump.js @@ -17,7 +17,7 @@ function Bump (args, pkg) { if (args.skip.bump) return Promise.resolve() var newVersion = pkg.version - return runLifecycleScript(args, 'prebump', null) + return runLifecycleScript(args, 'prebump') .then((stdout) => { if (stdout && stdout.trim().length) args.releaseAs = stdout.trim() return bumpVersion(args.releaseAs) @@ -32,7 +32,7 @@ function Bump (args, pkg) { } }) .then(() => { - return runLifecycleScript(args, 'postbump', newVersion, args) + return runLifecycleScript(args, 'postbump') }) .then(() => { return newVersion diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js index 96bb68935..1eb16178e 100644 --- a/lib/lifecycles/changelog.js +++ b/lib/lifecycles/changelog.js @@ -8,12 +8,12 @@ const writeFile = require('../write-file') module.exports = function (args, newVersion) { if (args.skip.changelog) return Promise.resolve() - return runLifecycleScript(args, 'prechangelog', newVersion, args) + return runLifecycleScript(args, 'prechangelog') .then(() => { return outputChangelog(args, newVersion) }) .then(() => { - return runLifecycleScript(args, 'postchangelog', newVersion, args) + return runLifecycleScript(args, 'postchangelog') }) } diff --git a/lib/lifecycles/commit.js b/lib/lifecycles/commit.js index ed7aa0306..c273949be 100644 --- a/lib/lifecycles/commit.js +++ b/lib/lifecycles/commit.js @@ -7,13 +7,13 @@ const runLifecycleScript = require('../run-lifecycle-script') module.exports = function (args, newVersion) { if (args.skip.commit) return Promise.resolve() - return runLifecycleScript(args, 'precommit', newVersion, args) + return runLifecycleScript(args, 'precommit') .then((message) => { if (message && message.length) args.message = message return execCommit(args, newVersion) }) .then(() => { - return runLifecycleScript(args, 'postcommit', newVersion, args) + return runLifecycleScript(args, 'postcommit') }) } diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index 2c955ce7a..b5bf7aefc 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -7,12 +7,12 @@ const runLifecycleScript = require('../run-lifecycle-script') module.exports = function (newVersion, pkgPrivate, args) { if (args.skip.tag) return Promise.resolve() - return runLifecycleScript(args, 'pretag', newVersion, args) + return runLifecycleScript(args, 'pretag') .then(() => { return execTag(newVersion, pkgPrivate, args) }) .then(() => { - return runLifecycleScript(args, 'posttag', newVersion, args) + return runLifecycleScript(args, 'posttag') }) } diff --git a/lib/run-lifecycle-script.js b/lib/run-lifecycle-script.js index f4c2baa07..a5014482b 100644 --- a/lib/run-lifecycle-script.js +++ b/lib/run-lifecycle-script.js @@ -3,11 +3,10 @@ const checkpoint = require('./checkpoint') const figures = require('figures') const runExec = require('./run-exec') -module.exports = function (args, hookName, newVersion) { +module.exports = function (args, hookName) { const scripts = args.scripts if (!scripts || !scripts[hookName]) return Promise.resolve() var command = scripts[hookName] - if (newVersion) command += ' --new-version="' + newVersion + '"' checkpoint(args, 'Running lifecycle script "%s"', [hookName]) checkpoint(args, '- execute command: "%s"', [command], chalk.blue(figures.info)) return runExec(args, command)