From 4e37d56b4c7c8ec61f5c82a30e2b768edc088ae2 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 16 Apr 2019 17:55:44 +0100 Subject: [PATCH] fix(help): remove dupe alias of check-mem in install - when running ghost install --help the mem-check alias was appearing twice - this is because the doctor options are loaded twice, once in start under setup, and once directly in install - removing this extra load fixes the issue because aliases are additive --- lib/commands/install.js | 1 - test/unit/commands/install-spec.js | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib/commands/install.js b/lib/commands/install.js index 51e4f7aa7..052ccada7 100644 --- a/lib/commands/install.js +++ b/lib/commands/install.js @@ -9,7 +9,6 @@ class InstallCommand extends Command { static configureOptions(commandName, yargs, extensions) { yargs = super.configureOptions(commandName, yargs, extensions); yargs = SetupCommand.configureOptions('setup', yargs, extensions, true); - yargs = DoctorCommand.configureOptions('doctor', yargs, extensions, true); return yargs; } diff --git a/test/unit/commands/install-spec.js b/test/unit/commands/install-spec.js index 8268ef600..b9e0318eb 100644 --- a/test/unit/commands/install-spec.js +++ b/test/unit/commands/install-spec.js @@ -12,7 +12,6 @@ describe('Unit: Commands > Install', function () { it('configureOptions adds setup & doctor options', function () { const superStub = sinon.stub().returnsArg(1); const setupStub = sinon.stub().returnsArg(1); - const doctorStub = sinon.stub().returnsArg(1); // Needed for extension class Command {} @@ -20,7 +19,6 @@ describe('Unit: Commands > Install', function () { const InstallCommand = proxyquire(modulePath, { './setup': {configureOptions: setupStub}, - './doctor': {configureOptions: doctorStub}, '../command': Command }); @@ -30,8 +28,6 @@ describe('Unit: Commands > Install', function () { expect(superStub.calledWithExactly('install', {yargs: true}, [{extensiona: true}])).to.be.true; expect(setupStub.calledOnce).to.be.true; expect(setupStub.calledWithExactly('setup', {yargs: true}, [{extensiona: true}], true)).to.be.true; - expect(doctorStub.calledOnce).to.be.true; - expect(doctorStub.calledWithExactly('doctor', {yargs: true}, [{extensiona: true}], true)).to.be.true; }); describe('run', function () {