nport 2.0.2 → 2.0.3
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/index.js +15 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -393,6 +393,13 @@ class UI {
|
|
|
393
393
|
if (!updateInfo || !updateInfo.shouldUpdate) return;
|
|
394
394
|
|
|
395
395
|
const border = "═".repeat(59);
|
|
396
|
+
const boxWidth = 59;
|
|
397
|
+
|
|
398
|
+
// Calculate padding dynamically
|
|
399
|
+
const currentVersionText = ` Current version: v${updateInfo.current}`;
|
|
400
|
+
const latestVersionText = ` Latest version: v${updateInfo.latest}`;
|
|
401
|
+
const runCommandText = ` Run: npm install -g ${CONFIG.PACKAGE_NAME}@latest`;
|
|
402
|
+
|
|
396
403
|
console.log(chalk.yellow(`\n╔${border}╗`));
|
|
397
404
|
console.log(
|
|
398
405
|
chalk.yellow("║") +
|
|
@@ -405,14 +412,14 @@ class UI {
|
|
|
405
412
|
chalk.yellow("║") +
|
|
406
413
|
chalk.gray(` Current version: `) +
|
|
407
414
|
chalk.red(`v${updateInfo.current}`) +
|
|
408
|
-
" ".repeat(
|
|
415
|
+
" ".repeat(boxWidth - currentVersionText.length) +
|
|
409
416
|
chalk.yellow("║")
|
|
410
417
|
);
|
|
411
418
|
console.log(
|
|
412
419
|
chalk.yellow("║") +
|
|
413
420
|
chalk.gray(` Latest version: `) +
|
|
414
421
|
chalk.green(`v${updateInfo.latest}`) +
|
|
415
|
-
" ".repeat(
|
|
422
|
+
" ".repeat(boxWidth - latestVersionText.length) +
|
|
416
423
|
chalk.yellow("║")
|
|
417
424
|
);
|
|
418
425
|
console.log(chalk.yellow(`╠${border}╣`));
|
|
@@ -420,7 +427,7 @@ class UI {
|
|
|
420
427
|
chalk.yellow("║") +
|
|
421
428
|
chalk.cyan(` Run: `) +
|
|
422
429
|
chalk.bold(`npm install -g ${CONFIG.PACKAGE_NAME}@latest`) +
|
|
423
|
-
" ".repeat(
|
|
430
|
+
" ".repeat(boxWidth - runCommandText.length) +
|
|
424
431
|
chalk.yellow("║")
|
|
425
432
|
);
|
|
426
433
|
console.log(chalk.yellow(`╚${border}╝\n`));
|
|
@@ -536,7 +543,9 @@ class TunnelOrchestrator {
|
|
|
536
543
|
|
|
537
544
|
// Validate binary
|
|
538
545
|
if (!BinaryManager.validate(PATHS.BIN_PATH)) {
|
|
539
|
-
|
|
546
|
+
analytics.trackTunnelError("binary_missing", "Cloudflared binary not found");
|
|
547
|
+
// Give analytics a moment to send before exiting
|
|
548
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
540
549
|
process.exit(1);
|
|
541
550
|
}
|
|
542
551
|
|
|
@@ -576,6 +585,8 @@ class TunnelOrchestrator {
|
|
|
576
585
|
analytics.trackTunnelError(errorType, error.message);
|
|
577
586
|
|
|
578
587
|
UI.displayError(error, spinner);
|
|
588
|
+
// Give analytics a moment to send before exiting
|
|
589
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
579
590
|
process.exit(1);
|
|
580
591
|
}
|
|
581
592
|
}
|