@clawcard/cli 2.0.5 → 2.0.6
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 +9 -10
package/package.json
CHANGED
package/src/splash.js
CHANGED
|
@@ -48,20 +48,19 @@ export async function performAutoUpdate() {
|
|
|
48
48
|
console.log(` Updating to v${latest}...`);
|
|
49
49
|
|
|
50
50
|
try {
|
|
51
|
-
execSync("npm i -g @clawcard/cli@latest", {
|
|
51
|
+
execSync("npm cache clean --force 2>/dev/null; npm i -g @clawcard/cli@latest", {
|
|
52
52
|
stdio: "pipe",
|
|
53
53
|
timeout: 60000,
|
|
54
54
|
});
|
|
55
|
-
console.log(` Updated to v${latest}`);
|
|
55
|
+
console.log(` Updated to v${latest}. Restarting...\n`);
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
57
|
+
// Re-run the same command with the updated CLI
|
|
58
|
+
const { spawnSync } = await import("child_process");
|
|
59
|
+
const result = spawnSync(process.argv[0], process.argv.slice(1), {
|
|
60
|
+
stdio: "inherit",
|
|
61
|
+
env: process.env,
|
|
62
|
+
});
|
|
63
|
+
process.exit(result.status ?? 0);
|
|
65
64
|
} catch {
|
|
66
65
|
// update failed — continue normally
|
|
67
66
|
}
|