cli: stop logging stopped watcher

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-24 14:17:30 +01:00
parent 8dfaa20c52
commit 5b3079694e
2 changed files with 6 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Stop logging "Stopped watcher" when shutting down the development backend.
+1 -2
View File
@@ -35,9 +35,8 @@ export async function serveBackend(options: BackendServeOptions) {
const waitForExit = async () => {
for (const signal of ['SIGINT', 'SIGTERM'] as const) {
process.on(signal, () => {
compiler.close(() => console.log('Stopped watcher'));
// exit instead of resolve. The process is shutting down and resolving a promise here logs an error
process.exit();
compiler.close(() => process.exit());
});
}