opencode-orchestrator 0.1.42 → 0.1.43
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/README.md +1 -1
- package/dist/scripts/postinstall.js +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
// scripts/postinstall.ts
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
5
|
-
import { join } from "path";
|
|
5
|
+
import { join, dirname } from "path";
|
|
6
6
|
import { homedir } from "os";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
7
8
|
var CONFIG_DIR = join(homedir(), ".config", "opencode");
|
|
8
9
|
var CONFIG_FILE = join(CONFIG_DIR, "opencode.json");
|
|
9
10
|
var PLUGIN_NAME = "opencode-orchestrator";
|
|
10
11
|
function getPluginPath() {
|
|
11
12
|
try {
|
|
12
|
-
let currentDir =
|
|
13
|
-
while (
|
|
13
|
+
let currentDir = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
while (true) {
|
|
14
15
|
if (existsSync(join(currentDir, "package.json"))) {
|
|
15
|
-
return currentDir
|
|
16
|
+
return currentDir;
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
18
|
+
const parentDir = dirname(currentDir);
|
|
19
|
+
if (parentDir === currentDir) {
|
|
19
20
|
break;
|
|
20
|
-
|
|
21
|
+
}
|
|
22
|
+
currentDir = parentDir;
|
|
21
23
|
}
|
|
22
24
|
return PLUGIN_NAME;
|
|
23
25
|
} catch {
|