onlineornot 1.3.0 → 1.4.1
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/onlineornot-dist/cli.js +28 -15
- package/package.json +1 -1
- package/onlineornot-dist/cli.js.map +0 -7
package/onlineornot-dist/cli.js
CHANGED
|
@@ -31114,7 +31114,7 @@ var import_node_os = __toESM(require("node:os"));
|
|
|
31114
31114
|
var import_node_path = __toESM(require("node:path"));
|
|
31115
31115
|
|
|
31116
31116
|
// package.json
|
|
31117
|
-
var version = "1.
|
|
31117
|
+
var version = "1.4.1";
|
|
31118
31118
|
var package_default = {
|
|
31119
31119
|
name: "onlineornot",
|
|
31120
31120
|
version,
|
|
@@ -38389,6 +38389,7 @@ async function uninstallHandler(args) {
|
|
|
38389
38389
|
}
|
|
38390
38390
|
|
|
38391
38391
|
// src/update.ts
|
|
38392
|
+
var import_node_child_process2 = require("node:child_process");
|
|
38392
38393
|
var import_promises3 = __toESM(require("node:fs/promises"));
|
|
38393
38394
|
var import_node_os7 = __toESM(require("node:os"));
|
|
38394
38395
|
var import_node_path8 = __toESM(require("node:path"));
|
|
@@ -38442,8 +38443,7 @@ async function updateHandler(args) {
|
|
|
38442
38443
|
);
|
|
38443
38444
|
return;
|
|
38444
38445
|
}
|
|
38445
|
-
logger.log(`Current version: ${
|
|
38446
|
-
logger.log("Checking for updates...");
|
|
38446
|
+
logger.log(source_default.dim(`Current version: ${currentVersion}`));
|
|
38447
38447
|
const response = await fetch(
|
|
38448
38448
|
`https://api.github.com/repos/${REPO2}/releases`,
|
|
38449
38449
|
{
|
|
@@ -38468,7 +38468,10 @@ async function updateHandler(args) {
|
|
|
38468
38468
|
logger.log(source_default.green("\u2713") + " You're already on the latest version!");
|
|
38469
38469
|
return;
|
|
38470
38470
|
}
|
|
38471
|
-
logger.log(
|
|
38471
|
+
logger.log("");
|
|
38472
|
+
logger.log(
|
|
38473
|
+
source_default.dim("Installing ") + "onlineornot" + source_default.dim(" version: ") + latestVersion
|
|
38474
|
+
);
|
|
38472
38475
|
if (args.check) {
|
|
38473
38476
|
if (isNewerVersion2(latestVersion, currentVersion)) {
|
|
38474
38477
|
logger.log("");
|
|
@@ -38487,16 +38490,16 @@ async function updateHandler(args) {
|
|
|
38487
38490
|
return;
|
|
38488
38491
|
}
|
|
38489
38492
|
logger.log("");
|
|
38490
|
-
|
|
38491
|
-
const
|
|
38492
|
-
|
|
38493
|
+
const currentBinary = process.execPath;
|
|
38494
|
+
const tempPath = `${currentBinary}.new`;
|
|
38495
|
+
try {
|
|
38496
|
+
(0, import_node_child_process2.execSync)(`curl -#fSL "${asset.browser_download_url}" -o "${tempPath}"`, {
|
|
38497
|
+
stdio: "inherit"
|
|
38498
|
+
});
|
|
38499
|
+
} catch {
|
|
38493
38500
|
logger.error("Failed to download update. Please try again later.");
|
|
38494
38501
|
return;
|
|
38495
38502
|
}
|
|
38496
|
-
const buffer = await binaryResponse.arrayBuffer();
|
|
38497
|
-
const currentBinary = process.execPath;
|
|
38498
|
-
const tempPath = `${currentBinary}.new`;
|
|
38499
|
-
await import_promises3.default.writeFile(tempPath, Buffer.from(buffer));
|
|
38500
38503
|
await import_promises3.default.chmod(tempPath, 493);
|
|
38501
38504
|
const backupPath = `${currentBinary}.backup`;
|
|
38502
38505
|
try {
|
|
@@ -38514,14 +38517,24 @@ async function updateHandler(args) {
|
|
|
38514
38517
|
await import_promises3.default.writeFile(import_node_path8.default.join(INSTALL_DIR3, "version"), latestVersion);
|
|
38515
38518
|
logger.log("");
|
|
38516
38519
|
logger.log(
|
|
38517
|
-
source_default.
|
|
38520
|
+
source_default.dim("\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588 \u2580 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580 ") + "\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 " + source_default.dim("\u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2588 \u2580\u2580\u2588\u2580\u2580")
|
|
38521
|
+
);
|
|
38522
|
+
logger.log(
|
|
38523
|
+
source_default.dim("\u2588\u2591\u2591\u2588 \u2588\u2591\u2591\u2588 \u2588 \u2588 \u2588\u2591\u2591\u2588 \u2588\u2580\u2580 ") + "\u2588\u2591\u2591\u2588 \u2588\u2584\u2584\u2580 " + source_default.dim("\u2588\u2591\u2591\u2588 \u2588\u2591\u2591\u2588 \u2588")
|
|
38524
|
+
);
|
|
38525
|
+
logger.log(
|
|
38526
|
+
source_default.dim("\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580 \u2580 \u2580 \u2580 \u2580\u2580\u2580 ") + "\u2580\u2580\u2580\u2580 \u2580 \u2580\u2580 " + source_default.dim("\u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580")
|
|
38518
38527
|
);
|
|
38519
38528
|
logger.log("");
|
|
38529
|
+
logger.log("");
|
|
38530
|
+
logger.log(source_default.dim(`Updated to version ${latestVersion}`));
|
|
38531
|
+
logger.log("");
|
|
38532
|
+
logger.log("onlineornot checks " + source_default.dim("# Manage checks"));
|
|
38533
|
+
logger.log("");
|
|
38520
38534
|
logger.log(
|
|
38521
|
-
source_default.dim(
|
|
38522
|
-
"Restart your terminal or run a new command to use the new version."
|
|
38523
|
-
)
|
|
38535
|
+
source_default.dim("For more information visit ") + "https://onlineornot.com/docs"
|
|
38524
38536
|
);
|
|
38537
|
+
logger.log("");
|
|
38525
38538
|
}
|
|
38526
38539
|
|
|
38527
38540
|
// src/whoami.ts
|