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) {
|
if (all || args.onlyDaemon) {
|
||||||
try {
|
try {
|
||||||
await killDaemon();
|
await killDaemon();
|
||||||
} catch {
|
} catch (e) {
|
||||||
errors.push('Failed to stop the Nx Daemon.');
|
errors.push('Failed to stop the Nx Daemon.', e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (all || args.onlyCache) {
|
if (all || args.onlyCache) {
|
||||||
try {
|
try {
|
||||||
await cleanupCacheEntries();
|
await cleanupCacheEntries();
|
||||||
} catch {
|
} catch (e) {
|
||||||
errors.push('Failed to clean up the cache directory.');
|
errors.push('Failed to clean up the cache directory.', e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (all || args.onlyWorkspaceData) {
|
if (all || args.onlyWorkspaceData) {
|
||||||
@ -61,12 +61,19 @@ export async function resetHandler(args: ResetCommandOptions) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await cleanupWorkspaceData();
|
await cleanupWorkspaceData();
|
||||||
} catch {
|
} catch (e) {
|
||||||
errors.push('Failed to clean up the workspace data directory.');
|
errors.push(
|
||||||
|
'Failed to clean up the workspace data directory.',
|
||||||
|
e.toString()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (all || args.onlyCloud) {
|
if (all || args.onlyCloud) {
|
||||||
|
try {
|
||||||
await resetCloudClient();
|
await resetCloudClient();
|
||||||
|
} catch (e) {
|
||||||
|
errors.push('Failed to reset the Nx Cloud client.', e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
output.error({
|
output.error({
|
||||||
@ -81,8 +88,10 @@ export async function resetHandler(args: ResetCommandOptions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function killDaemon() {
|
async function killDaemon(): Promise<void> {
|
||||||
|
if (daemonClient.enabled()) {
|
||||||
return daemonClient.stop();
|
return daemonClient.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resetCloudClient() {
|
async function resetCloudClient() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user