fleetbo-cockpit-cli 1.0.247 → 1.0.249
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 +17 -35
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -469,9 +469,9 @@ if (command === 'alex') {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
if (aiData.status === 'message') {
|
|
472
|
-
rawMsg = "
|
|
472
|
+
rawMsg = "[Chat Mode] " + rawMsg;
|
|
473
473
|
}
|
|
474
|
-
|
|
474
|
+
|
|
475
475
|
process.stdout.write(`[ALEX_START]${rawMsg}[ALEX_END]`);
|
|
476
476
|
}
|
|
477
477
|
|
|
@@ -899,9 +899,6 @@ else if (['page', 'g', 'generate'].includes(command)) {
|
|
|
899
899
|
}
|
|
900
900
|
else {
|
|
901
901
|
const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
|
|
902
|
-
|
|
903
|
-
// 🟢 FIX 1 : On crée une variable pour garder la trace du serveur Vite
|
|
904
|
-
let devServerProcess = null;
|
|
905
902
|
|
|
906
903
|
function killProcessOnPort(port) {
|
|
907
904
|
try {
|
|
@@ -912,23 +909,21 @@ else {
|
|
|
912
909
|
} catch (e) {}
|
|
913
910
|
}
|
|
914
911
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
912
|
+
const killNetworkService = () => {
|
|
913
|
+
if (uplinkProcess) {
|
|
914
|
+
try {
|
|
915
|
+
if (process.platform === 'win32') {
|
|
916
|
+
spawn('taskkill', ['/pid', String(uplinkProcess.pid), '/T', '/F'], {
|
|
917
|
+
stdio: 'ignore', detached: true, shell: false
|
|
918
|
+
}).unref();
|
|
919
|
+
} else {
|
|
920
|
+
uplinkProcess.kill('SIGINT');
|
|
921
|
+
}
|
|
922
|
+
console.log('[Fleetbo] Engine closed.');
|
|
923
|
+
} catch (e) {
|
|
924
|
+
console.error('[Fleetbo] Error closing tunnel:', e.message);
|
|
928
925
|
}
|
|
929
|
-
}
|
|
930
|
-
killProc(uplinkProcess);
|
|
931
|
-
killProc(devServerProcess);
|
|
926
|
+
}
|
|
932
927
|
};
|
|
933
928
|
|
|
934
929
|
let isExiting = false;
|
|
@@ -945,15 +940,6 @@ else {
|
|
|
945
940
|
}
|
|
946
941
|
killNetworkService();
|
|
947
942
|
killProcessOnPort(PORT);
|
|
948
|
-
|
|
949
|
-
try {
|
|
950
|
-
// 🟢 FIX 3 : On met un timeout ultra-court (1s) pour ne jamais bloquer la sortie
|
|
951
|
-
await axios.post(UPDATE_NETWORK_URL, { keyApp, networkUrl: '', tester: testerEmail }, { timeout: 1000 });
|
|
952
|
-
console.log('\x1b[32m[Fleetbo] Network status reset to offline.\x1b[0m');
|
|
953
|
-
} catch (e) {
|
|
954
|
-
// On ignore silencieusement si ça échoue, le but principal est de quitter.
|
|
955
|
-
}
|
|
956
|
-
|
|
957
943
|
console.log('[Fleetbo] Bye.');
|
|
958
944
|
process.exit(code);
|
|
959
945
|
}
|
|
@@ -993,8 +979,7 @@ else {
|
|
|
993
979
|
|
|
994
980
|
const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
995
981
|
|
|
996
|
-
|
|
997
|
-
devServerProcess = spawn(npmCmd, ['run', 'dev', '--silent', '--', '--host', '127.0.0.1', '--port', String(PORT)], {
|
|
982
|
+
const devServer = spawn(`${npmCmd} run dev --silent -- --host 127.0.0.1 --port ${PORT}`, {
|
|
998
983
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
999
984
|
shell: true,
|
|
1000
985
|
env: {
|
|
@@ -1007,9 +992,6 @@ else {
|
|
|
1007
992
|
|
|
1008
993
|
let connectionStarted = false;
|
|
1009
994
|
let detectedPort = PORT;
|
|
1010
|
-
|
|
1011
|
-
// 🟢 (Inclut la correction du Buffer de texte vue précédemment)
|
|
1012
|
-
let viteBuffer = "";
|
|
1013
995
|
|
|
1014
996
|
devServer.stdout.on('data', (data) => {
|
|
1015
997
|
const output = data.toString();
|