@syengup/friday-channel-next 0.0.32 → 0.0.35
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/install.js +29 -2
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -96,6 +96,33 @@ if (missing.length) {
|
|
|
96
96
|
process.exit(1);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// --------------- version check ---------------
|
|
100
|
+
{
|
|
101
|
+
const MIN_OPENCLAW = [2026, 5, 12];
|
|
102
|
+
try {
|
|
103
|
+
const verOut = execSync(`${openclawCmd} --version`, { encoding: "utf8" }).trim();
|
|
104
|
+
const m = verOut.match(/(\d{4})\.(\d{1,2})\.(\d{1,2})/);
|
|
105
|
+
if (m) {
|
|
106
|
+
const cur = [parseInt(m[1], 10), parseInt(m[2], 10), parseInt(m[3], 10)];
|
|
107
|
+
let tooOld = false;
|
|
108
|
+
for (let i = 0; i < 3; i++) {
|
|
109
|
+
if (cur[i] > MIN_OPENCLAW[i]) break;
|
|
110
|
+
if (cur[i] < MIN_OPENCLAW[i]) { tooOld = true; break; }
|
|
111
|
+
}
|
|
112
|
+
if (tooOld) {
|
|
113
|
+
err(`OpenClaw version ${m[0]} is too old.`);
|
|
114
|
+
err(`Friday Next channel requires OpenClaw 2026.5.12 or above.`);
|
|
115
|
+
err(`Please update: ${openclawCmd} update`);
|
|
116
|
+
err(`请先升级 OpenClaw 至 2026.5.12 或以上版本:${openclawCmd} update`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch {
|
|
121
|
+
// If version check itself fails, don't block — continue with a warning
|
|
122
|
+
warn("Could not determine OpenClaw version — continuing anyway.");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
99
126
|
const PKG = has("pnpm") ? "pnpm" : has("npm") ? "npm" : null;
|
|
100
127
|
if (!PKG) {
|
|
101
128
|
err("pnpm or npm is required but not found. Install one first.");
|
|
@@ -305,12 +332,12 @@ if (sudoUser) {
|
|
|
305
332
|
|
|
306
333
|
log("Restarting OpenClaw gateway...");
|
|
307
334
|
try {
|
|
308
|
-
const out = execSync(`${openclawCmd} gateway restart`, { encoding: "utf8", stdio: "pipe" });
|
|
335
|
+
const out = execSync(`${openclawCmd} gateway restart`, { encoding: "utf8", stdio: "pipe", timeout: 15000 });
|
|
309
336
|
if (out.trim()) console.log(out.trim());
|
|
310
337
|
} catch (e) {
|
|
311
338
|
if (e.stdout?.trim()) console.log(e.stdout.trim());
|
|
312
339
|
if (e.stderr?.trim()) console.error(e.stderr.trim());
|
|
313
|
-
warn("Gateway restart failed. The plugin files are installed but the gateway
|
|
340
|
+
warn("Gateway restart failed or timed out. The plugin files are installed but the gateway may not have restarted.");
|
|
314
341
|
warn("Check 'openclaw gateway status' and restart manually: openclaw gateway restart");
|
|
315
342
|
}
|
|
316
343
|
|