Skip to content

Commit c9d52ee

Browse files
committed
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 angular#17682
1 parent c1e1c8b commit c9d52ee

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)