opencode-hub 1.0.6 → 1.0.7
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/oc-tui.js +14 -0
- package/package.json +1 -1
package/oc-tui.js
CHANGED
|
@@ -74,6 +74,20 @@ function checkForUpdates() {
|
|
|
74
74
|
execSync("npm install -g opencode-ai@latest", { stdio: "inherit", timeout: 120000 });
|
|
75
75
|
process.stderr.write("\x1b[32m > Updated to " + latest + "\x1b[0m\n\n");
|
|
76
76
|
} catch (e) {}
|
|
77
|
+
|
|
78
|
+
// Auto-update NPM plugins
|
|
79
|
+
try {
|
|
80
|
+
var ocPath = join(CONFIG_DIR, "opencode.json");
|
|
81
|
+
if (existsSync(ocPath)) {
|
|
82
|
+
var oc = JSON.parse(readFileSync(ocPath, "utf-8"));
|
|
83
|
+
var pluginsArr = oc.plugin || oc.plugins || [];
|
|
84
|
+
var npmPlugs = pluginsArr.filter(function(p) { return typeof p === "string" && p.includes("@latest") && !p.startsWith("."); });
|
|
85
|
+
if (npmPlugs.length > 0) {
|
|
86
|
+
process.stderr.write("\x1b[33m > Auto-updating NPM plugins: " + npmPlugs.join(", ") + "\x1b[0m\n");
|
|
87
|
+
execSync("npm install --no-save " + npmPlugs.join(" "), { cwd: CONFIG_DIR, stdio: "ignore", timeout: 60000 });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} catch (e) {}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
checkForUpdates();
|