deckide 3.5.5 → 3.5.7

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.
Files changed (2) hide show
  1. package/bin/deckide.js +13 -10
  2. 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 ──
@@ -449,11 +449,14 @@ if (isServerRunningOnPort(port)) {
449
449
  process.exit(0);
450
450
  }
451
451
 
452
- // Kill old server if running on a different port
453
- const oldPid = getRunningPid();
454
- if (oldPid) {
455
- console.log('Stopping old server...');
456
- stopServer();
452
+ // Kill old server if running on a different port (only in background mode,
453
+ // FG mode is always spawned by background mode which already handles this)
454
+ if (!startOptions.fg) {
455
+ const oldPid = getRunningPid();
456
+ if (oldPid) {
457
+ console.log('Stopping old server...');
458
+ stopServer();
459
+ }
457
460
  }
458
461
 
459
462
  // ── Background mode (default) ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckide",
3
- "version": "3.5.5",
3
+ "version": "3.5.7",
4
4
  "description": "Deck IDE - Browser-based IDE with terminal, file explorer, and git integration",
5
5
  "type": "module",
6
6
  "bin": {