Skip to content

Commit 3fdd54d

Browse files
committed
fix(@angular/cli): do not error when apps is missing from the config
1 parent cd520c1 commit 3fdd54d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
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)