fleetbo-cockpit-cli 1.0.161 → 1.0.164

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/cli.js +21 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -995,7 +995,15 @@ else {
995
995
  const killNetworkService = () => {
996
996
  if (uplinkProcess) {
997
997
  try {
998
- uplinkProcess.kill('SIGINT');
998
+ if (process.platform === 'win32') {
999
+ // Windows ne supporte pas SIGINT sur les process enfants
1000
+ // On utilise taskkill pour forcer la fermeture propre
1001
+ try {
1002
+ execSync(`taskkill /pid ${uplinkProcess.pid} /T /F`, { stdio: 'ignore' });
1003
+ } catch (e) {}
1004
+ } else {
1005
+ uplinkProcess.kill('SIGINT');
1006
+ }
999
1007
  console.log('[Fleetbo] Engine closed.');
1000
1008
  } catch (e) {
1001
1009
  console.error('[Fleetbo] Error closing tunnel:', e.message);
@@ -1004,7 +1012,7 @@ else {
1004
1012
  };
1005
1013
 
1006
1014
  let isExiting = false;
1007
-
1015
+
1008
1016
  async function cleanupAndExit(code = 0) {
1009
1017
  if (isExiting) return;
1010
1018
  isExiting = true;
@@ -1020,7 +1028,17 @@ else {
1020
1028
  console.log('[Fleetbo] Bye.');
1021
1029
  process.exit(code);
1022
1030
  }
1023
-
1031
+
1032
+ // 🪟 WINDOWS FIX : Ctrl+C est intercepté par cmd.exe avant Node.js
1033
+ // On capture le signal au niveau stdin pour éviter l'invite "O/N"
1034
+ if (process.platform === 'win32') {
1035
+ const rl = require('readline').createInterface({
1036
+ input: process.stdin,
1037
+ output: process.stdout
1038
+ });
1039
+ rl.on('SIGINT', () => cleanupAndExit(0));
1040
+ }
1041
+
1024
1042
  process.on('SIGINT', () => cleanupAndExit(0));
1025
1043
  process.on('SIGTERM', () => cleanupAndExit(0));
1026
1044
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.161",
3
+ "version": "1.0.164",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",