Skip to content

Commit

Permalink
cleanup(devkit): improve error messaging when project doesnt exist fo…
Browse files Browse the repository at this point in the history
…r readTargetOptions (#19108)
  • Loading branch information
AgentEnder authored Sep 13, 2023
1 parent f639883 commit ae154e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/devkit/src/executors/read-target-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export function readTargetOptions<T = any>(
const projectConfiguration = (
context.workspace || context.projectsConfigurations
).projects[project];

if (!projectConfiguration) {
throw new Error(`Unable to find project ${project}`);
}

const targetConfiguration = projectConfiguration.targets[target];

// TODO(v18): remove Workspaces.
Expand Down
1 change: 0 additions & 1 deletion packages/nx/src/utils/split-target.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ProjectGraph } from '../config/project-graph';
import { ProjectConfiguration } from '../config/workspace-json-project-json';

export function splitTarget(
s: string,
Expand Down

0 comments on commit ae154e7

Please sign in to comment.