fleetbo-cockpit-cli 1.0.36 → 1.0.37
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 +12 -12
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -199,7 +199,7 @@ const removeRouteFromAppJs = (moduleName) => {
|
|
|
199
199
|
|
|
200
200
|
if (content !== originalContent) {
|
|
201
201
|
fs.writeFileSync(appJsPath, content);
|
|
202
|
-
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName}
|
|
202
|
+
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName} removed from App.js.`);
|
|
203
203
|
return true;
|
|
204
204
|
}
|
|
205
205
|
return false;
|
|
@@ -506,46 +506,46 @@ if (command === 'alex') {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
// ============================================
|
|
509
|
-
// COMMAND: rm (ANNIHILATION
|
|
509
|
+
// COMMAND: rm (MODULE ANNIHILATION)
|
|
510
510
|
// ============================================
|
|
511
511
|
else if (command === 'rm') {
|
|
512
512
|
const moduleName = args[1];
|
|
513
513
|
if (!moduleName) {
|
|
514
|
-
console.error('\n\x1b[31m❌
|
|
514
|
+
console.error('\n\x1b[31m❌ Error: Module name required.\x1b[0m');
|
|
515
515
|
console.log('\x1b[90mUsage: npm run fleetbo rm [ModuleName]\x1b[0m\n');
|
|
516
516
|
process.exit(1);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
console.log(`\n\x1b[33m🗑️
|
|
519
|
+
console.log(`\n\x1b[33m🗑️ Annihilating module: ${moduleName}...\x1b[0m`);
|
|
520
520
|
|
|
521
|
-
// 1.
|
|
521
|
+
// 1. Define physical paths
|
|
522
522
|
const ktPath = path.join(process.cwd(), 'public', 'native', 'android', `${moduleName}.kt`);
|
|
523
523
|
const jsxPath = path.join(process.cwd(), 'src', 'app', 'mocks', `${moduleName}.jsx`);
|
|
524
524
|
|
|
525
525
|
let actionsDone = 0;
|
|
526
526
|
|
|
527
|
-
// 2.
|
|
527
|
+
// 2. Eradicate Metal Engine (Kotlin)
|
|
528
528
|
if (fs.existsSync(ktPath)) {
|
|
529
529
|
fs.unlinkSync(ktPath);
|
|
530
|
-
console.log(` \x1b[32m[Deleted]\x1b[0m
|
|
530
|
+
console.log(` \x1b[32m[Deleted]\x1b[0m Metal file (.kt) eradicated.`);
|
|
531
531
|
actionsDone++;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
// 3.
|
|
534
|
+
// 3. Eradicate Virtual Twin (Mock JSX)
|
|
535
535
|
if (fs.existsSync(jsxPath)) {
|
|
536
536
|
fs.unlinkSync(jsxPath);
|
|
537
|
-
console.log(` \x1b[32m[Deleted]\x1b[0m
|
|
537
|
+
console.log(` \x1b[32m[Deleted]\x1b[0m Virtual Twin (.jsx) eradicated.`);
|
|
538
538
|
actionsDone++;
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
// 4.
|
|
541
|
+
// 4. Disinfect System Core (App.js)
|
|
542
542
|
const unrouted = removeRouteFromAppJs(moduleName);
|
|
543
543
|
if (unrouted) actionsDone++;
|
|
544
544
|
|
|
545
545
|
if (actionsDone === 0) {
|
|
546
|
-
console.log(`\n\x1b[31m⚠️
|
|
546
|
+
console.log(`\n\x1b[31m⚠️ No trace of module "${moduleName}" found in the OS.\x1b[0m\n`);
|
|
547
547
|
} else {
|
|
548
|
-
console.log(`\n\x1b[32m✅ Module ${moduleName}
|
|
548
|
+
console.log(`\n\x1b[32m✅ Module ${moduleName} successfully eradicated from the kernel.\x1b[0m\n`);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
|