Skip to content

Commit

Permalink
fix(angular): handle different workspace version and format when fall…
Browse files Browse the repository at this point in the history
…ing back to the angular cli (#8993)
  • Loading branch information
leosvelperez committed Feb 16, 2022
1 parent a86f5d8 commit 1cae869
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/cli/lib/init-local.ts
Expand Up @@ -103,6 +103,7 @@ export function initLocal(workspace: Workspace) {
})
);
} else {
require('@nrwl/tao/src/compat/compat');
loadCli(workspace, '@angular/cli/lib/init.js');
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/tao/src/compat/compat.ts
Expand Up @@ -58,12 +58,12 @@ if (!patched) {
`@angular-devkit/core/src/workspace/json/reader`,
]);
const originalReadJsonWorkspace = readJsonUtils.readJsonWorkspace;
readJsonUtils.readJsonWorkspace = (
readJsonUtils.readJsonWorkspace = async (
path,
host: { readFile: (p) => Promise<string> }
) => {
try {
return originalReadJsonWorkspace(path, host);
return await originalReadJsonWorkspace(path, host);
} catch {
logger.debug(
'[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic'
Expand Down

0 comments on commit 1cae869

Please sign in to comment.