From c5e1ee2a63a3488484f5392a5180cf97026f948d Mon Sep 17 00:00:00 2001 From: Joel Edwards Date: Tue, 2 Jan 2018 22:38:04 -0700 Subject: [PATCH] feat: publish only if commit+push succeed (#229) --- README.md | 2 +- lib/lifecycles/tag.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2148df477..41c059cc0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ _how it works:_ 3. when you're ready to release to npm: 1. `git checkout master; git pull origin master` 2. run `standard-version` - 3. `git push --follow-tags origin master; npm publish` + 3. `git push --follow-tags origin master && npm publish` `standard-version` does the following: diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index 1491801e0..c7dc53144 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -27,7 +27,7 @@ function execTag (newVersion, pkgPrivate, args) { return runExec(args, 'git tag ' + tagOption + args.tagPrefix + newVersion + ' -m "' + formatCommitMessage(args.message, newVersion) + '"') .then(() => { var message = 'git push --follow-tags origin master' - if (pkgPrivate !== true) message += '; npm publish' + if (pkgPrivate !== true) message += ' && npm publish' if (args.prerelease !== undefined) message += ' --tag prerelease' checkpoint(args, 'Run `%s` to publish', [message], chalk.blue(figures.info))