Skip to content

fix(@angular/cli): throw error when specified project does not exist #17922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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