Skip to content

Commit

Permalink
fix(commands): throw when init command is called with mobile flag
Browse files Browse the repository at this point in the history
Show error message when user uses the mobile flag in conjunction with the init command.

Fix angular#2679
  • Loading branch information
hollannikas committed Oct 17, 2016
1 parent 3aa61d5 commit 153cd41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions packages/angular-cli/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 2 additions & 7 deletions tests/acceptance/init.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 153cd41

Please sign in to comment.