Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

Commit 9a8abfa

Browse files
hollannikasBrocco
authored andcommitted
fix(init): throw when called with mobile flag (angular#2753)
Show error message when user uses the mobile flag in conjunction with the init command. Closes angular#2679
1 parent 326e247 commit 9a8abfa

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

packages/angular-cli/commands/init.ts

+7
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ const InitCommand: any = Command.extend({
114114
new SilentError('We currently do not support a name of `' + packageName + '`.'));
115115
}
116116

117+
if (commandOptions.mobile) {
118+
return Promise.reject(new SilentError(
119+
'The --mobile flag has been disabled temporarily while we await an update of ' +
120+
'angular-universal for supporting NgModule. Sorry for the inconvenience.'
121+
));
122+
}
123+
117124
blueprintOpts.blueprint = normalizeBlueprint(blueprintOpts.blueprint);
118125

119126
return installBlueprint.run(blueprintOpts)

tests/acceptance/init.spec.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,8 @@ describe('Acceptance: ng init', function () {
117117
]).then(confirmBlueprinted);
118118
});
119119

120-
it('ng init --mobile', () => {
121-
return ng([
122-
'init',
123-
'--skip-npm',
124-
'--skip-bower',
125-
'--mobile'
126-
]).then(() => confirmBlueprinted(true));
120+
it('ng init with mobile flag does throw exception', function () {
121+
expect(ng(['init', '--mobile'])).to.throw;
127122
});
128123

129124
it('ng init can run in created folder', function () {

0 commit comments

Comments
 (0)