Skip to content

Commit

Permalink
fix(publish): Allow composed version command to decide when to verify…
Browse files Browse the repository at this point in the history
… working tree
  • Loading branch information
evocateur committed Aug 20, 2018
1 parent 9f26d08 commit e61aa67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/publish/index.js
Expand Up @@ -146,8 +146,6 @@ class PublishCommand extends Command {
findVersionedUpdates() {
let chain = Promise.resolve();

chain = chain.then(() => this.verifyWorkingTreeClean());

if (this.options.bump === "from-git") {
chain = chain.then(() => this.detectFromGit());
} else if (this.options.canary) {
Expand All @@ -166,6 +164,9 @@ class PublishCommand extends Command {
detectFromGit() {
let chain = Promise.resolve();

// attempting to publish a tagged release with local changes is not allowed
chain = chain.then(() => this.verifyWorkingTreeClean());

chain = chain.then(() => getCurrentTags(this.execOpts));
chain = chain.then(taggedPackageNames => {
if (!taggedPackageNames.length) {
Expand Down Expand Up @@ -199,6 +200,9 @@ class PublishCommand extends Command {

let chain = Promise.resolve();

// attempting to publish a canary release with local changes is not allowed
chain = chain.then(() => this.verifyWorkingTreeClean());

// find changed packages since last release, if any
chain = chain.then(() =>
collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, {
Expand Down

0 comments on commit e61aa67

Please sign in to comment.