fleetbo-cockpit-cli 1.0.160 → 1.0.163
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 +21 -8
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -982,12 +982,24 @@ else if (['page', 'g', 'generate'].includes(command)) {
|
|
|
982
982
|
// ============================================
|
|
983
983
|
else {
|
|
984
984
|
const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
|
|
985
|
-
|
|
985
|
+
|
|
986
986
|
function killProcessOnPort(port) {
|
|
987
987
|
try {
|
|
988
988
|
if (process.platform !== 'win32') {
|
|
989
989
|
const pid = execSync(`lsof -ti:${port} ${NULL_DEV}`).toString().trim();
|
|
990
990
|
if (pid) execSync(`kill -9 ${pid.split('\n').join(' ')} ${NULL_DEV}`);
|
|
991
|
+
} else {
|
|
992
|
+
// 🪓 LE TUEUR DE ZOMBIES WINDOWS
|
|
993
|
+
// Cherche l'ID du processus (PID) qui utilise notre port, et le tue de force (/F)
|
|
994
|
+
const output = execSync(`netstat -ano | findstr :${port}`).toString();
|
|
995
|
+
const lines = output.split('\n');
|
|
996
|
+
for (const line of lines) {
|
|
997
|
+
const parts = line.trim().split(/\s+/);
|
|
998
|
+
if (parts.length >= 5 && parts[1].includes(`:${port}`)) {
|
|
999
|
+
const pid = parts[parts.length - 1];
|
|
1000
|
+
execSync(`taskkill /PID ${pid} /F /T >nul 2>&1`);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
991
1003
|
}
|
|
992
1004
|
} catch (e) {}
|
|
993
1005
|
}
|
|
@@ -1080,19 +1092,20 @@ else {
|
|
|
1080
1092
|
'Starting the development server',
|
|
1081
1093
|
'You can now view',
|
|
1082
1094
|
'vite v',
|
|
1083
|
-
'VITE v',
|
|
1084
|
-
'ready in',
|
|
1085
|
-
'
|
|
1086
|
-
'
|
|
1095
|
+
'VITE v',
|
|
1096
|
+
'ready in',
|
|
1097
|
+
'Local:', // 👈 Plus simple et infaillible
|
|
1098
|
+
'Network:', // 👈 Plus simple et infaillible
|
|
1087
1099
|
'press h + enter',
|
|
1088
|
-
'> vite',
|
|
1100
|
+
'> vite',
|
|
1089
1101
|
'> fleetbo',
|
|
1090
1102
|
'> npx fleetbo-cockpit-cli@latest'
|
|
1091
1103
|
];
|
|
1092
1104
|
|
|
1093
|
-
// On filtre les lignes pour ne garder que le vrai code/debug
|
|
1094
1105
|
const filteredOutput = lines.filter(line => {
|
|
1095
|
-
|
|
1106
|
+
// On nettoie les codes couleurs invisibles avant de lire
|
|
1107
|
+
const cleanLine = line.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '');
|
|
1108
|
+
return !forbiddenTerms.some(term => cleanLine.includes(term));
|
|
1096
1109
|
}).join('\n');
|
|
1097
1110
|
|
|
1098
1111
|
// S'il reste quelque chose d'utile (un console.log du dev, un warning, une vraie erreur), on l'affiche
|