@clawcard/cli 2.0.6 → 2.0.8
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/splash.js +7 -4
package/package.json
CHANGED
package/src/splash.js
CHANGED
|
@@ -42,23 +42,26 @@ export async function checkForUpdate() {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export async function performAutoUpdate() {
|
|
45
|
+
if (process.env.CLAWCARD_SKIP_UPDATE) return;
|
|
46
|
+
|
|
45
47
|
const latest = await checkForUpdate();
|
|
46
48
|
if (!latest) return;
|
|
47
49
|
|
|
48
50
|
console.log(` Updating to v${latest}...`);
|
|
49
51
|
|
|
50
52
|
try {
|
|
51
|
-
execSync(
|
|
53
|
+
execSync(`npm cache clean --force 2>/dev/null; npm i -g @clawcard/cli@${latest}`, {
|
|
52
54
|
stdio: "pipe",
|
|
53
55
|
timeout: 60000,
|
|
54
56
|
});
|
|
55
57
|
console.log(` Updated to v${latest}. Restarting...\n`);
|
|
56
58
|
|
|
57
|
-
// Re-run the
|
|
59
|
+
// Re-run using the clawcard binary directly (not the cached process)
|
|
60
|
+
const args = process.argv.slice(2); // skip node + script path
|
|
58
61
|
const { spawnSync } = await import("child_process");
|
|
59
|
-
const result = spawnSync(
|
|
62
|
+
const result = spawnSync("clawcard", args, {
|
|
60
63
|
stdio: "inherit",
|
|
61
|
-
env: process.env,
|
|
64
|
+
env: { ...process.env, CLAWCARD_SKIP_UPDATE: "1" },
|
|
62
65
|
});
|
|
63
66
|
process.exit(result.status ?? 0);
|
|
64
67
|
} catch {
|