Skip to content

Commit 1352545

Browse files
authored
bug(help): resolve issue when using --help (angular#3522)
Fixes angular#3195 and angular#3168
1 parent 0c1c391 commit 1352545

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

packages/angular-cli/ember-cli/lib/cli/cli.js

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ module.exports = CLI;
2525
CLI.prototype.run = function(environment) {
2626
return Promise.hash(environment).then(function(environment) {
2727
var args = environment.cliArgs.slice();
28+
29+
if (args[0] === '--help') {
30+
if (args.length === 1) {
31+
args[0] = 'help';
32+
} else {
33+
args.shift();
34+
args.push('--help');
35+
}
36+
}
37+
2838
var commandName = args.shift();
2939
var commandArgs = args;
3040
var helpOptions;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {silentNg} from '../../../utils/process';
2+
3+
4+
export default function() {
5+
return Promise.resolve()
6+
.then(() => silentNg('--help', 'build'))
7+
.then(() => process.chdir('/'))
8+
.then(() => silentNg('--help', 'build'));
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {silentNg} from '../../../utils/process';
2+
3+
4+
export default function() {
5+
return Promise.resolve()
6+
.then(() => silentNg('--help'))
7+
.then(() => process.chdir('/'))
8+
.then(() => silentNg('--help'));
9+
}

tests/e2e/tests/commands/help.ts renamed to tests/e2e/tests/commands/help/help.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {silentNg} from '../../utils/process';
1+
import {silentNg} from '../../../utils/process';
22

33

44
export default function() {

0 commit comments

Comments
 (0)