From 8d41cc3609bceae80c60ec3adb2ce1cd5557bad0 Mon Sep 17 00:00:00 2001 From: hollannikas Date: Mon, 17 Oct 2016 23:38:16 +0300 Subject: [PATCH] fix(commands): throw when init command is called with mobile flag Show error message when user uses the mobile flag in conjunction with the init command. Closes #2679 --- packages/angular-cli/commands/init.ts | 7 +++++++ tests/acceptance/init.spec.js | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/angular-cli/commands/init.ts b/packages/angular-cli/commands/init.ts index c291bec3493a..ebd5e6e4c54f 100644 --- a/packages/angular-cli/commands/init.ts +++ b/packages/angular-cli/commands/init.ts @@ -114,6 +114,13 @@ const InitCommand: any = Command.extend({ new SilentError('We currently do not support a name of `' + packageName + '`.')); } + if (commandOptions.mobile) { + return Promise.reject(new SilentError( + 'The --mobile flag has been disabled temporarily while we await an update of ' + + 'angular-universal for supporting NgModule. Sorry for the inconvenience.' + )); + } + blueprintOpts.blueprint = normalizeBlueprint(blueprintOpts.blueprint); return installBlueprint.run(blueprintOpts) diff --git a/tests/acceptance/init.spec.js b/tests/acceptance/init.spec.js index 8005867726b7..457e7882d6dc 100644 --- a/tests/acceptance/init.spec.js +++ b/tests/acceptance/init.spec.js @@ -117,13 +117,8 @@ describe('Acceptance: ng init', function () { ]).then(confirmBlueprinted); }); - it('ng init --mobile', () => { - return ng([ - 'init', - '--skip-npm', - '--skip-bower', - '--mobile' - ]).then(() => confirmBlueprinted(true)); + it('ng init with mobile flag does throw exception', function () { + expect(ng(['init', '--mobile'])).to.throw; }); it('ng init can run in created folder', function () {