fleetbo-cockpit-cli 1.0.164 → 1.0.167
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 +8 -14
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -996,11 +996,9 @@ else {
|
|
|
996
996
|
if (uplinkProcess) {
|
|
997
997
|
try {
|
|
998
998
|
if (process.platform === 'win32') {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
execSync(`taskkill /pid ${uplinkProcess.pid} /T /F`, { stdio: 'ignore' });
|
|
1003
|
-
} catch (e) {}
|
|
999
|
+
spawn('taskkill', ['/pid', String(uplinkProcess.pid), '/T', '/F'], {
|
|
1000
|
+
stdio: 'ignore', detached: true, shell: false
|
|
1001
|
+
}).unref();
|
|
1004
1002
|
} else {
|
|
1005
1003
|
uplinkProcess.kill('SIGINT');
|
|
1006
1004
|
}
|
|
@@ -1012,7 +1010,7 @@ else {
|
|
|
1012
1010
|
};
|
|
1013
1011
|
|
|
1014
1012
|
let isExiting = false;
|
|
1015
|
-
|
|
1013
|
+
|
|
1016
1014
|
async function cleanupAndExit(code = 0) {
|
|
1017
1015
|
if (isExiting) return;
|
|
1018
1016
|
isExiting = true;
|
|
@@ -1028,15 +1026,11 @@ else {
|
|
|
1028
1026
|
console.log('[Fleetbo] Bye.');
|
|
1029
1027
|
process.exit(code);
|
|
1030
1028
|
}
|
|
1031
|
-
|
|
1032
|
-
// 🪟 WINDOWS FIX : Ctrl+C
|
|
1033
|
-
// On capture le signal au niveau stdin pour éviter l'invite "O/N"
|
|
1029
|
+
|
|
1030
|
+
// 🪟 WINDOWS FIX : capture Ctrl+C via readline pour éviter l'invite "O/N"
|
|
1034
1031
|
if (process.platform === 'win32') {
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
output: process.stdout
|
|
1038
|
-
});
|
|
1039
|
-
rl.on('SIGINT', () => cleanupAndExit(0));
|
|
1032
|
+
const rlWin = require('readline').createInterface({ input: process.stdin, output: process.stdout });
|
|
1033
|
+
rlWin.on('SIGINT', () => cleanupAndExit(0));
|
|
1040
1034
|
}
|
|
1041
1035
|
|
|
1042
1036
|
process.on('SIGINT', () => cleanupAndExit(0));
|