Skip to content

Commit f5e126f

Browse files
kgajeraalan-agius4
authored andcommitted
fix(@angular/cli): throw error when specified project does not exist
Currently this falls through to a misleading error for an unsupported build target. Closes #17682 (cherry picked from commit ba0f7ac)
1 parent 903f720 commit f5e126f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/angular/cli/models/architect-command.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ export abstract class ArchitectCommand<
6666
return;
6767
}
6868

69-
const commandLeftovers = options['--'];
7069
let projectName = options.project;
70+
if (projectName && !this._workspace.projects.has(projectName)) {
71+
throw new Error(`Project '${projectName}' does not exist.`);
72+
}
73+
74+
const commandLeftovers = options['--'];
7175
const targetProjectNames: string[] = [];
7276
for (const [name, project] of this._workspace.projects) {
7377
if (project.targets.has(this.target)) {

0 commit comments

Comments
 (0)