@syengup/friday-channel-next 0.0.32 → 0.0.34
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 +27 -0
- 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.");
|