opencode-hub 1.0.10 → 1.0.12
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 +4 -2
- package/package.json +1 -1
package/oc-tui.js
CHANGED
|
@@ -36,12 +36,14 @@ function loadNpmPlugins() {
|
|
|
36
36
|
try {
|
|
37
37
|
// OpenCode installs npm plugins into ~/.cache/opencode/node_modules
|
|
38
38
|
var cachePkg = join(homedir(), ".cache", "opencode", "node_modules", name, "package.json");
|
|
39
|
-
// Fallback: config-local node_modules, then global npm
|
|
39
|
+
// Fallback: config-local node_modules, then global npm, then local repos
|
|
40
40
|
var globalNpm = process.platform === "win32"
|
|
41
41
|
? join(homedir(), "AppData", "Roaming", "npm", "node_modules")
|
|
42
42
|
: join("/usr", "lib", "node_modules");
|
|
43
|
+
var repoPkg = join(CONFIG_DIR, "repos", "intisy", name, "package.json");
|
|
43
44
|
var pkgPath = existsSync(cachePkg) ? cachePkg
|
|
44
45
|
: existsSync(join(CONFIG_DIR, "node_modules", name, "package.json")) ? join(CONFIG_DIR, "node_modules", name, "package.json")
|
|
46
|
+
: existsSync(repoPkg) ? repoPkg
|
|
45
47
|
: join(globalNpm, name, "package.json");
|
|
46
48
|
if (existsSync(pkgPath)) {
|
|
47
49
|
version = JSON.parse(readFileSync(pkgPath, "utf-8")).version || "";
|
|
@@ -70,7 +72,7 @@ function migrateConfigs() {
|
|
|
70
72
|
}
|
|
71
73
|
var legacyPlugins = join(CONFIG_DIR, "plugins.json");
|
|
72
74
|
if (existsSync(legacyPlugins) && !existsSync(PLUGINS_JSON)) {
|
|
73
|
-
try { copyFileSync(legacyPlugins, PLUGINS_JSON); } catch {}
|
|
75
|
+
try { copyFileSync(legacyPlugins, PLUGINS_JSON); try { unlinkSync(legacyPlugins); } catch {} } catch {}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|