Skip to content

Commit

Permalink
fix(help): remove dupe alias of check-mem in install
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ErisDS authored and acburdine committed Apr 20, 2019
1 parent 84f9012 commit 4e37d56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions test/unit/commands/install-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ 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 {}
Command.configureOptions = superStub;

const InstallCommand = proxyquire(modulePath, {
'./setup': {configureOptions: setupStub},
'./doctor': {configureOptions: doctorStub},
'../command': Command
});

Expand All @@ -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 () {
Expand Down

0 comments on commit 4e37d56

Please sign in to comment.