fix(core): fix postinstall when nx is not resolveable (#26433)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> `postinstall` task exits 1 when errors are thrown. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> `postinstall` task always exits 0. Errors are OK because nothing here is critical. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes https://github.com/nrwl/nx/issues/26400
This commit is contained in:
parent
795bec023b
commit
e44199142d
@ -13,7 +13,6 @@ import { logger } from '../src/utils/logger';
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
let errored = false;
|
|
||||||
try {
|
try {
|
||||||
setupWorkspaceContext(workspaceRoot);
|
setupWorkspaceContext(workspaceRoot);
|
||||||
if (isMainNxPackage() && fileExists(join(workspaceRoot, 'nx.json'))) {
|
if (isMainNxPackage() && fileExists(join(workspaceRoot, 'nx.json'))) {
|
||||||
@ -39,7 +38,6 @@ import { logger } from '../src/utils/logger';
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errored = true;
|
|
||||||
logger.verbose(e);
|
logger.verbose(e);
|
||||||
} finally {
|
} finally {
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
@ -47,7 +45,7 @@ import { logger } from '../src/utils/logger';
|
|||||||
`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`
|
`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`
|
||||||
);
|
);
|
||||||
|
|
||||||
process.exit(errored ? 1 : 0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user