deckide 3.5.5 → 3.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/deckide.js +5 -5
- package/package.json +1 -1
package/bin/deckide.js
CHANGED
|
@@ -269,12 +269,12 @@ if (command === 'port') {
|
|
|
269
269
|
const wasRunning = isServerRunningOnPort(currentPort) || getRunningPid();
|
|
270
270
|
if (wasRunning) {
|
|
271
271
|
stopServer();
|
|
272
|
-
await new Promise(r => setTimeout(r, 1000));
|
|
273
272
|
// Re-exec as start (background, no open)
|
|
274
273
|
const child = spawn(process.execPath, [fileURLToPath(import.meta.url), 'start', '--no-open'], {
|
|
275
274
|
stdio: 'inherit',
|
|
276
275
|
});
|
|
277
|
-
child.on('exit', (code) => process.exit(code));
|
|
276
|
+
child.on('exit', (code) => process.exit(code ?? 0));
|
|
277
|
+
await new Promise(() => {});
|
|
278
278
|
} else {
|
|
279
279
|
process.exit(0);
|
|
280
280
|
}
|
|
@@ -400,15 +400,15 @@ if (command === 'restart') {
|
|
|
400
400
|
if (stopServer()) {
|
|
401
401
|
console.log('Server stopped.');
|
|
402
402
|
}
|
|
403
|
-
// Wait a moment for port to free
|
|
404
|
-
await new Promise(r => setTimeout(r, 1000));
|
|
405
403
|
}
|
|
406
404
|
// Re-exec as start (background)
|
|
407
405
|
const restartArgs = ['start', ...args.slice(1)];
|
|
408
406
|
const child = spawn(process.execPath, [fileURLToPath(import.meta.url), ...restartArgs], {
|
|
409
407
|
stdio: 'inherit',
|
|
410
408
|
});
|
|
411
|
-
child.on('exit', (code) => process.exit(code));
|
|
409
|
+
child.on('exit', (code) => process.exit(code ?? 0));
|
|
410
|
+
// Prevent fall-through to unknown command check
|
|
411
|
+
await new Promise(() => {});
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// ── deckide / deckide start ──
|