Skip to content

Commit

Permalink
fix(@angular/cli): throw error when specified project does not exist
Browse files Browse the repository at this point in the history
Currently this falls through to a misleading error for an unsupported build target.

Closes #17682

(cherry picked from commit ba0f7ac)
  • Loading branch information
kgajera authored and alan-agius4 committed Jun 16, 2020
1 parent 903f720 commit f5e126f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/angular/cli/models/architect-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ export abstract class ArchitectCommand<
return;
}

const commandLeftovers = options['--'];
let projectName = options.project;
if (projectName && !this._workspace.projects.has(projectName)) {
throw new Error(`Project '${projectName}' does not exist.`);
}

const commandLeftovers = options['--'];
const targetProjectNames: string[] = [];
for (const [name, project] of this._workspace.projects) {
if (project.targets.has(this.target)) {
Expand Down

0 comments on commit f5e126f

Please sign in to comment.