Skip to content

Commit

Permalink
fix(version): Throw errors if tree is unclean or duplicating tagged r…
Browse files Browse the repository at this point in the history
…elease
  • Loading branch information
evocateur committed Aug 17, 2018
1 parent 5da0e42 commit d8ee1cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commands/version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const semver = require("semver");

const Command = require("@lerna/command");
const ConventionalCommitUtilities = require("@lerna/conventional-commits");
const checkWorkingTree = require("@lerna/check-working-tree");
const PromptUtilities = require("@lerna/prompt");
const output = require("@lerna/output");
const collectUpdates = require("@lerna/collect-updates");
Expand Down Expand Up @@ -144,6 +145,11 @@ class VersionCommand extends Command {
() => this.confirmVersions(),
];

// amending a commit probably means the working tree is dirty
if (amend !== true) {
tasks.unshift(() => checkWorkingTree(this.execOpts));
}

return pWaterfall(tasks);
}

Expand Down
1 change: 1 addition & 0 deletions commands/version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"test": "echo \"Run tests from root\" && exit 1"
},
"dependencies": {
"@lerna/check-working-tree": "file:../../utils/check-working-tree",
"@lerna/child-process": "file:../../core/child-process",
"@lerna/collect-updates": "file:../../utils/collect-updates",
"@lerna/command": "file:../../core/command",
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d8ee1cf

Please sign in to comment.