Skip to content

Commit

Permalink
fix(version): Passing --no-changelog should not disable root versio…
Browse files Browse the repository at this point in the history
…ning
  • Loading branch information
evocateur committed Feb 11, 2019
1 parent 45a05ac commit 83c33a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion commands/version/__tests__/version-command.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ describe("VersionCommand", () => {
describe("normal mode", () => {
it("versions changed packages", async () => {
const testDir = await initFixture("normal");
await lernaVersion(testDir)();
// when --conventional-commits is absent,
// --no-changelog should have _no_ effect
await lernaVersion(testDir)("--no-changelog");

expect(checkWorkingTree).toHaveBeenCalled();

Expand Down
5 changes: 3 additions & 2 deletions commands/version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ class VersionCommand extends Command {
)
);

if (!independentVersions && changelog) {
if (!independentVersions) {
this.project.version = this.globalVersion;

if (conventionalCommits) {
if (conventionalCommits && changelog) {
chain = chain.then(() =>
ConventionalCommitUtilities.updateChangelog(this.project.manifest, "root", {
changelogPreset,
Expand Down Expand Up @@ -598,6 +598,7 @@ class VersionCommand extends Command {
this.releaseNotes.map(({ notes, name }) => {
const tag = name === "fixed" ? this.tags[0] : this.tags.find(t => t.startsWith(name));

/* istanbul ignore if */
if (!tag) {
return Promise.resolve();
}
Expand Down

0 comments on commit 83c33a3

Please sign in to comment.