Skip to content

Commit 8484202

Browse files
committed
fix(core): serve + test --watch executor should not exit immediately
closes #96
1 parent bfd7649 commit 8484202

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/core/src/executors/serve/executor.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function dotnetRunExecutor(
3636
);
3737
}
3838

39-
const runDotnetRun = (
39+
const runDotnetRun = async (
4040
dotnetClient: DotNetClient,
4141
project: string,
4242
options: ServeExecutorSchema,
@@ -47,9 +47,8 @@ const runDotnetRun = (
4747
}));
4848

4949
childProcess = dotnetClient.run(project, true, opts);
50-
return handleChildProcessPassthrough(childProcess).then(async () => {
51-
await rimraf(projectDirectory + '/bin');
52-
await rimraf(projectDirectory + '/obj');
53-
return { success: true };
54-
});
50+
await handleChildProcessPassthrough(childProcess);
51+
await rimraf(projectDirectory + '/bin');
52+
await rimraf(projectDirectory + '/obj');
53+
return { success: true };
5554
};

packages/utils/src/lib/utility-functions/childprocess.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ export async function handleChildProcessPassthrough(
4343

4444
//catches uncaught exceptions
4545
process.on('uncaughtException', exitHandler);
46+
47+
return new Promise<void>((resolve) => {
48+
resolver = resolve;
49+
});
4650
}

0 commit comments

Comments
 (0)