Skip to content

Commit

Permalink
chore(core): prepare Angular specific error only before throwing it (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored Sep 21, 2023
1 parent 82fb209 commit 57dc105
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/nx/src/project-graph/project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import { readNxJson } from '../config/nx-json';
*/
export function readCachedProjectGraph(): ProjectGraph {
const projectGraphCache: ProjectGraph = readProjectGraphCache();
const angularSpecificError = fileExists(`${workspaceRoot}/angular.json`)
? stripIndents`
if (!projectGraphCache) {
const angularSpecificError = fileExists(`${workspaceRoot}/angular.json`)
? stripIndents`
Make sure invoke 'node ./decorate-angular-cli.js' in your postinstall script.
The decorated CLI will compute the project graph.
'ng --help' should say 'Smart, Fast and Extensible Build System'.
`
: '';
if (!projectGraphCache) {
: '';

throw new Error(stripIndents`
[readCachedProjectGraph] ERROR: No cached ProjectGraph is available.
Expand Down

0 comments on commit 57dc105

Please sign in to comment.