nemoris 0.1.16 → 0.1.18
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/package.json +1 -1
- package/src/cli-main.js +14 -8
package/package.json
CHANGED
package/src/cli-main.js
CHANGED
|
@@ -2775,15 +2775,21 @@ export async function main(argv = process.argv) {
|
|
|
2775
2775
|
console.log(` Current version: ${currentVersion}`);
|
|
2776
2776
|
console.log(" Checking for updates...\n");
|
|
2777
2777
|
try {
|
|
2778
|
-
|
|
2779
|
-
// Re-read
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2778
|
+
execSync("npm i -g nemoris@latest 2>&1", { encoding: "utf8", timeout: 60_000 });
|
|
2779
|
+
// Re-read the installed package.json to get the actual new version
|
|
2780
|
+
let newVersion;
|
|
2781
|
+
try {
|
|
2782
|
+
const globalRoot = execSync("npm root -g", { encoding: "utf8", timeout: 5_000 }).trim();
|
|
2783
|
+
const installedPkg = JSON.parse(fs.readFileSync(path.join(globalRoot, "nemoris", "package.json"), "utf8"));
|
|
2784
|
+
newVersion = installedPkg.version || null;
|
|
2785
|
+
} catch {
|
|
2786
|
+
newVersion = null;
|
|
2787
|
+
}
|
|
2788
|
+
if (newVersion && newVersion !== currentVersion) {
|
|
2789
|
+
console.log(` ✓ Updated: ${currentVersion} → ${newVersion}`);
|
|
2786
2790
|
console.log(" Restart your daemon: nemoris restart");
|
|
2791
|
+
} else {
|
|
2792
|
+
console.log(` ✓ Already on the latest version (${currentVersion})`);
|
|
2787
2793
|
}
|
|
2788
2794
|
} catch (err) {
|
|
2789
2795
|
console.error(" ✗ Update failed:", err.message?.split("\n")[0] || "unknown error");
|