Skip to content

Commit 897f07c

Browse files
committed
CR
1 parent 8095f10 commit 897f07c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/internal/main/watch_mode.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ let restarting = false;
107107
async function restart() {
108108
if (restarting) return;
109109
restarting = true;
110-
if (!kPreserveOutput) process.stdout.write(clear);
111-
process.stdout.write(`${green}Restarting ${kCommandStr}${white}\n`);
112-
await stop();
113-
start();
114-
restarting = false;
110+
try {
111+
if (!kPreserveOutput) process.stdout.write(clear);
112+
process.stdout.write(`${green}Restarting ${kCommandStr}${white}\n`);
113+
await stop();
114+
start();
115+
} finally {
116+
restarting = false;
117+
}
115118
}
116119

117120
emitExperimentalWarning('Watch mode');

0 commit comments

Comments
 (0)