@miloya/oc-minimax-status 0.1.4 → 0.1.5
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/index.js +15 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,8 +19,22 @@ const CONFIG_PATH = path.join(
|
|
|
19
19
|
|
|
20
20
|
function syncPluginFiles() {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
let pkgDir;
|
|
23
23
|
const home = process.env.HOME || process.env.USERPROFILE;
|
|
24
|
+
|
|
25
|
+
// Try multiple ways to find package directory
|
|
26
|
+
if (process.env.BUN_INSTALL_CACHE_DIR) {
|
|
27
|
+
// Bun cache directory
|
|
28
|
+
pkgDir = path.join(process.env.BUN_INSTALL_CACHE_DIR, "node_modules", "@miloya", "oc-minimax-status");
|
|
29
|
+
} else if (process.env.npm_package_json) {
|
|
30
|
+
pkgDir = path.dirname(process.env.npm_package_json);
|
|
31
|
+
} else if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
32
|
+
pkgDir = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
} else {
|
|
34
|
+
// Fallback: OpenCode uses ~/.cache/opencode/
|
|
35
|
+
pkgDir = path.join(home, ".cache", "opencode", "node_modules", "@miloya", "oc-minimax-status");
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
const plugins = path.join(home, ".config", "opencode", "plugins");
|
|
25
39
|
const commands = path.join(home, ".config", "opencode", "commands");
|
|
26
40
|
|