fix(core): only stop daemon if enabled (#28146)
<!-- 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` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes https://github.com/nrwl/nx/issues/27971
This commit is contained in:
parent
94932ec0e1
commit
0061b858b2
@ -42,15 +42,15 @@ export async function resetHandler(args: ResetCommandOptions) {
|
||||
if (all || args.onlyDaemon) {
|
||||
try {
|
||||
await killDaemon();
|
||||
} catch {
|
||||
errors.push('Failed to stop the Nx Daemon.');
|
||||
} catch (e) {
|
||||
errors.push('Failed to stop the Nx Daemon.', e.toString());
|
||||
}
|
||||
}
|
||||
if (all || args.onlyCache) {
|
||||
try {
|
||||
await cleanupCacheEntries();
|
||||
} catch {
|
||||
errors.push('Failed to clean up the cache directory.');
|
||||
} catch (e) {
|
||||
errors.push('Failed to clean up the cache directory.', e.toString());
|
||||
}
|
||||
}
|
||||
if (all || args.onlyWorkspaceData) {
|
||||
@ -61,12 +61,19 @@ export async function resetHandler(args: ResetCommandOptions) {
|
||||
}
|
||||
try {
|
||||
await cleanupWorkspaceData();
|
||||
} catch {
|
||||
errors.push('Failed to clean up the workspace data directory.');
|
||||
} catch (e) {
|
||||
errors.push(
|
||||
'Failed to clean up the workspace data directory.',
|
||||
e.toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
if (all || args.onlyCloud) {
|
||||
try {
|
||||
await resetCloudClient();
|
||||
} catch (e) {
|
||||
errors.push('Failed to reset the Nx Cloud client.', e.toString());
|
||||
}
|
||||
}
|
||||
if (errors.length > 0) {
|
||||
output.error({
|
||||
@ -81,9 +88,11 @@ export async function resetHandler(args: ResetCommandOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
function killDaemon() {
|
||||
async function killDaemon(): Promise<void> {
|
||||
if (daemonClient.enabled()) {
|
||||
return daemonClient.stop();
|
||||
}
|
||||
}
|
||||
|
||||
async function resetCloudClient() {
|
||||
// Remove nx cloud marker files. This helps if the use happens to run `nx-cloud start-ci-run` or
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user