Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 743a0ef

Browse files
committedMar 22, 2017
fix(@angular/cli): do not error when apps is missing from the config
1 parent ba4ddf1 commit 743a0ef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎packages/@angular/cli/utilities/app-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
const SilentError = require('silent-error');
2+
const chalk = require('chalk');
3+
14
import { CliConfig } from '../models/config';
25

36
export function getAppFromConfig(nameOrIndex?: String) {
47
const apps: any[] = CliConfig.getValue('apps');
8+
if (!apps) {
9+
throw new SilentError(chalk.red('Unable to find any apps in `.angular-cli.json`.'));
10+
}
11+
512
let app = apps[0];
613
if (nameOrIndex) {
714
if (nameOrIndex.match(/^[0-9]+$/)) {

0 commit comments

Comments
 (0)
Please sign in to comment.