@robinpath/cli 3.0.1 → 3.0.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/dist/cli.mjs +16 -13
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -18598,7 +18598,7 @@ function getNativeModules() {
|
|
|
18598
18598
|
import { join as join3, basename as basename2 } from "node:path";
|
|
18599
18599
|
import { homedir as homedir2, platform as platform2 } from "node:os";
|
|
18600
18600
|
import { existsSync as existsSync2 } from "node:fs";
|
|
18601
|
-
var CLI_VERSION = true ? "3.0.
|
|
18601
|
+
var CLI_VERSION = true ? "3.0.2" : "3.0.2";
|
|
18602
18602
|
var FLAG_QUIET = false;
|
|
18603
18603
|
var FLAG_VERBOSE = false;
|
|
18604
18604
|
var FLAG_AUTO_ACCEPT = false;
|
|
@@ -19778,28 +19778,31 @@ async function checkForUpdates() {
|
|
|
19778
19778
|
if (latest !== CLI_VERSION) {
|
|
19779
19779
|
console.log(
|
|
19780
19780
|
`
|
|
19781
|
-
${color.
|
|
19781
|
+
${color.dim("Update available:")} ${color.green("v" + latest)} ${color.dim("(current: v" + CLI_VERSION + ")")}`
|
|
19782
19782
|
);
|
|
19783
|
-
console.log(
|
|
19783
|
+
console.log(`${color.dim("Run")} ${color.cyan("robinpath update")} ${color.dim("to upgrade")}
|
|
19784
19784
|
`);
|
|
19785
19785
|
}
|
|
19786
19786
|
} catch {
|
|
19787
19787
|
}
|
|
19788
19788
|
}
|
|
19789
|
-
function handleUpdate() {
|
|
19790
|
-
const isWindows = platform4() === "win32";
|
|
19791
|
-
const env = { ...process.env, ROBINPATH_CURRENT_VERSION: CLI_VERSION };
|
|
19789
|
+
async function handleUpdate() {
|
|
19792
19790
|
try {
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19791
|
+
log(color.dim("Checking for updates..."));
|
|
19792
|
+
const res = await fetch("https://registry.npmjs.org/@robinpath/cli/latest");
|
|
19793
|
+
const data = await res.json();
|
|
19794
|
+
const latest = data.version;
|
|
19795
|
+
if (latest === CLI_VERSION) {
|
|
19796
|
+
log(color.green(`\u2713 Already on latest version (v${CLI_VERSION})`));
|
|
19797
|
+
return;
|
|
19800
19798
|
}
|
|
19799
|
+
log(`Updating v${CLI_VERSION} \u2192 v${latest}...`);
|
|
19800
|
+
execSync("npm install -g @robinpath/cli@latest", { stdio: "inherit" });
|
|
19801
|
+
log(color.green(`\u2713 Updated to v${latest}`));
|
|
19802
|
+
log(color.dim("Restart robinpath to use the new version."));
|
|
19801
19803
|
} catch (err) {
|
|
19802
19804
|
console.error(color.red("Update failed:") + ` ${err.message}`);
|
|
19805
|
+
console.error(color.dim("Try manually: npm install -g @robinpath/cli"));
|
|
19803
19806
|
process.exit(1);
|
|
19804
19807
|
}
|
|
19805
19808
|
}
|