@seflless/ghosttown 1.1.0 → 1.1.2
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/bin/ghosttown.js +26 -12
- package/package.json +1 -1
package/bin/ghosttown.js
CHANGED
|
@@ -643,22 +643,36 @@ function getLocalIPs() {
|
|
|
643
643
|
|
|
644
644
|
function printBanner(url) {
|
|
645
645
|
const localIPs = getLocalIPs();
|
|
646
|
-
console.log('\n' + '═'.repeat(50));
|
|
647
|
-
console.log('
|
|
648
|
-
console.log('
|
|
649
|
-
console.log(
|
|
646
|
+
// console.log('\n' + '═'.repeat(50));
|
|
647
|
+
console.log('');
|
|
648
|
+
// console.log(' 👻 ghosttown');
|
|
649
|
+
// console.log('═'.repeat(50));
|
|
650
|
+
const labels = [
|
|
651
|
+
[' Open:', url],
|
|
652
|
+
[' Network:', ''],
|
|
653
|
+
[' Shell:', getShell()],
|
|
654
|
+
[' Home:', homedir()],
|
|
655
|
+
];
|
|
656
|
+
|
|
657
|
+
console.log(labels[0].join(' '));
|
|
658
|
+
|
|
659
|
+
const network = [labels[1].join(' ')];
|
|
660
|
+
|
|
650
661
|
if (localIPs.length > 0) {
|
|
651
|
-
|
|
662
|
+
let networkCount = 0;
|
|
652
663
|
for (const ip of localIPs) {
|
|
653
|
-
|
|
664
|
+
networkCount++;
|
|
665
|
+
const spaces = networkCount !== 1 ? ' ' : '';
|
|
666
|
+
network.push(`${spaces}http://${ip}:${HTTP_PORT}\n`);
|
|
654
667
|
}
|
|
655
668
|
}
|
|
656
|
-
console.log(`\n
|
|
657
|
-
|
|
658
|
-
console.log('
|
|
659
|
-
|
|
660
|
-
console.log('
|
|
661
|
-
console.log('
|
|
669
|
+
console.log(`\n${network.join('')}`);
|
|
670
|
+
// Shell
|
|
671
|
+
console.log(labels[2].join(' '));
|
|
672
|
+
// Home
|
|
673
|
+
console.log(labels[3].join(' '));
|
|
674
|
+
console.log('');
|
|
675
|
+
console.log(' Press Ctrl+C to stop.\n');
|
|
662
676
|
}
|
|
663
677
|
|
|
664
678
|
process.on('SIGINT', () => {
|