fleetbo-cockpit-cli 1.0.167 → 1.0.168
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/cli.js +14 -8
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -996,9 +996,11 @@ else {
|
|
|
996
996
|
if (uplinkProcess) {
|
|
997
997
|
try {
|
|
998
998
|
if (process.platform === 'win32') {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
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) {}
|
|
1002
1004
|
} else {
|
|
1003
1005
|
uplinkProcess.kill('SIGINT');
|
|
1004
1006
|
}
|
|
@@ -1010,7 +1012,7 @@ else {
|
|
|
1010
1012
|
};
|
|
1011
1013
|
|
|
1012
1014
|
let isExiting = false;
|
|
1013
|
-
|
|
1015
|
+
|
|
1014
1016
|
async function cleanupAndExit(code = 0) {
|
|
1015
1017
|
if (isExiting) return;
|
|
1016
1018
|
isExiting = true;
|
|
@@ -1026,11 +1028,15 @@ else {
|
|
|
1026
1028
|
console.log('[Fleetbo] Bye.');
|
|
1027
1029
|
process.exit(code);
|
|
1028
1030
|
}
|
|
1029
|
-
|
|
1030
|
-
// 🪟 WINDOWS FIX :
|
|
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"
|
|
1031
1034
|
if (process.platform === 'win32') {
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1035
|
+
const rl = require('readline').createInterface({
|
|
1036
|
+
input: process.stdin,
|
|
1037
|
+
output: process.stdout
|
|
1038
|
+
});
|
|
1039
|
+
rl.on('SIGINT', () => cleanupAndExit(0));
|
|
1034
1040
|
}
|
|
1035
1041
|
|
|
1036
1042
|
process.on('SIGINT', () => cleanupAndExit(0));
|