diff --git a/lib/index.js b/lib/index.js index 2a1e766d..4c485805 100644 --- a/lib/index.js +++ b/lib/index.js @@ -499,7 +499,7 @@ class Generator extends Base { questionStorage.setPath(name, answer); }); - if (!this.options['skip-cache'] && !this.options.skipCache) { + if (!this.options.skipCache) { promptSuggestion.storeAnswers( this._globalConfig, questions, @@ -1071,13 +1071,9 @@ class Generator extends Base { // Pass down the default options so they're correctly mirrored down the chain. options = { ...options, - skipInstall: this.options.skipInstall || this.options['skip-install'], - 'skip-install': this.options.skipInstall || this.options['skip-install'], - skipCache: this.options.skipCache || this.options['skip-cache'], - 'skip-cache': this.options.skipCache || this.options['skip-cache'], - forceInstall: this.options.forceInstall || this.options['force-install'], - 'force-install': - this.options.forceInstall || this.options['force-install'], + skipInstall: this.options.skipInstall, + skipCache: this.options.skipCache, + forceInstall: this.options.forceInstall, skipLocalCache: this.options.skipLocalCache, destinationRoot: this._destinationRoot }; diff --git a/test/base.js b/test/base.js index dfb8f407..83dd6ebf 100644 --- a/test/base.js +++ b/test/base.js @@ -828,12 +828,6 @@ describe('Base', () => { setTimeout(() => { this.dummy.run().then(() => { sinon.assert.callOrder(runSpy, this.spy); - assert.equal(this.spy.thisValues[0].options.skipInstall, true); - assert.equal(this.spy.thisValues[0].options['skip-install'], true); - assert.equal(this.spy.thisValues[0].options.forceInstall, true); - assert.equal(this.spy.thisValues[0].options['force-install'], true); - assert.equal(this.spy.thisValues[0].options.skipCache, true); - assert.equal(this.spy.thisValues[0].options['skip-cache'], true); assert(this.spy.calledAfter(runSpy)); done(); }); diff --git a/test/generators-compose-workflow.js b/test/generators-compose-workflow.js index 568721e6..c47def4e 100644 --- a/test/generators-compose-workflow.js +++ b/test/generators-compose-workflow.js @@ -89,30 +89,6 @@ describe('Multiples generators', () => { this.spyEnd1, this.spyEnd2 ); - assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true); assert(this.spyInit1.calledAfter(runSpy)); assert(this.spyInit2.calledAfter(this.spyInit1)); assert(this.spyExec1.calledAfter(this.spyInit2)); @@ -143,30 +119,6 @@ describe('Multiples generators', () => { this.spyEnd2, this.spyEnd1 ); - assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true); assert(this.spyInit2.calledAfter(runSpy)); assert(this.spyInit1.calledAfter(this.spyInit2)); assert(this.spyExec2.calledAfter(this.spyInit1)); @@ -211,42 +163,6 @@ describe('Multiples generators', () => { this.spyEnd1, this.spyEnd2 ); - assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec3.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec3.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec3.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec3.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec3.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec3.thisValues[0].options['skip-cache'], true); assert(this.spyInit1.calledAfter(runSpy)); assert(this.spyInit2.calledAfter(this.spyInit1)); assert(this.spyInit3.calledAfter(this.spyInit2)); @@ -307,30 +223,6 @@ describe('Multiples generators', () => { this.spyEnd1, this.spyEnd2 ); - assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true); assert(writingSpy1.calledAfter(runSpy)); assert(this.spyInit1.calledAfter(writingSpy1)); assert(this.spyInit2.calledAfter(this.spyInit1)); @@ -404,30 +296,6 @@ describe('Multiples generators', () => { this.spyEnd1, this.spyEnd2 ); - assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec1.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec1.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true); - assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['skip-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true); - assert.equal( - this.spyExec2.thisValues[0].options['force-install'], - true - ); - assert.equal(this.spyExec2.thisValues[0].options.skipCache, true); - assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true); assert(writingSpy1.calledAfter(runSpy)); assert(this.spyInit1.calledAfter(writingSpy1)); assert(this.spyExec1.calledAfter(this.spyInit1));