@construct-space/cli 1.4.2 → 1.4.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/dist/index.js +18 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10485,15 +10485,30 @@ function update() {
|
|
|
10485
10485
|
const rt = detect();
|
|
10486
10486
|
try {
|
|
10487
10487
|
if (rt.name === "bun") {
|
|
10488
|
-
|
|
10488
|
+
try {
|
|
10489
|
+
execSync5("bun pm cache rm", { stdio: "inherit" });
|
|
10490
|
+
} catch {}
|
|
10491
|
+
execSync5(`bun install -g ${PKG_NAME}@${latest}`, { stdio: "inherit" });
|
|
10489
10492
|
} else {
|
|
10490
|
-
execSync5(`npm install -g ${PKG_NAME}
|
|
10493
|
+
execSync5(`npm install -g --prefer-online ${PKG_NAME}@${latest}`, { stdio: "inherit" });
|
|
10491
10494
|
}
|
|
10492
|
-
console.log(source_default.green(`Updated to v${latest}`));
|
|
10493
10495
|
} catch (err) {
|
|
10494
10496
|
console.error(source_default.red(`Update failed: ${err.message}`));
|
|
10495
10497
|
process.exit(1);
|
|
10496
10498
|
}
|
|
10499
|
+
try {
|
|
10500
|
+
const installed = execSync5(`${rt.name === "bun" ? "bun" : "npm"} ${rt.name === "bun" ? "pm ls -g" : "ls -g --depth=0"} ${PKG_NAME}`, { encoding: "utf-8" });
|
|
10501
|
+
const match = installed.match(new RegExp(PKG_NAME.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "@(\\d[^\\s]*)"));
|
|
10502
|
+
const resolved = match ? match[1] : "unknown";
|
|
10503
|
+
if (resolved && resolved !== latest) {
|
|
10504
|
+
console.warn(source_default.yellow(`Installed ${resolved} but expected ${latest}.`));
|
|
10505
|
+
console.warn(source_default.dim(" Try: bun pm cache rm && bun install -g " + PKG_NAME + "@" + latest));
|
|
10506
|
+
return;
|
|
10507
|
+
}
|
|
10508
|
+
console.log(source_default.green(`Updated to v${latest}`));
|
|
10509
|
+
} catch {
|
|
10510
|
+
console.log(source_default.green(`Updated to v${latest}`));
|
|
10511
|
+
}
|
|
10497
10512
|
}
|
|
10498
10513
|
|
|
10499
10514
|
// src/commands/graph/init.ts
|