Skip to content

Commit

Permalink
fix(init): Consume lernaVersion from options, not instance property
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Aug 15, 2018
1 parent 12b4280 commit 89e31d2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions commands/init/index.js
Expand Up @@ -29,6 +29,7 @@ class InitCommand extends Command {

initialize() {
this.exact = this.options.exact;
this.lernaVersion = this.options.lernaVersion;

if (!this.gitInitialized()) {
this.logger.info("", "Initializing Git repository");
Expand Down
6 changes: 0 additions & 6 deletions core/command/__tests__/command.test.js
Expand Up @@ -57,12 +57,6 @@ describe("core-command", () => {
// convenience to avoid silly "not implemented errors"
const testFactory = (argv = {}) => new OkCommand(Object.assign({ cwd: testDir }, argv));

describe(".lernaVersion", () => {
it("should be added to the instance", async () => {
expect(testFactory({ lernaVersion: "__TEST__" }).lernaVersion).toBe("__TEST__");
});
});

describe(".logger", () => {
it("should be added to the instance", async () => {
const command = testFactory();
Expand Down
3 changes: 1 addition & 2 deletions core/command/index.js
Expand Up @@ -26,10 +26,9 @@ class Command {
this._argv = argv;
log.silly("argv", argv);

this.lernaVersion = argv.lernaVersion;
if (!argv.composed) {
// composed commands have already logged the lerna version
log.info("version", this.lernaVersion);
log.info("version", argv.lernaVersion);
}

// "FooCommand" => "foo"
Expand Down

0 comments on commit 89e31d2

Please sign in to comment.