@andyqiu/codeforge 0.5.22 → 0.5.24
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/dist/adr-init.js +18 -1
- package/dist/index.js +19 -2
- package/package.json +1 -1
package/dist/adr-init.js
CHANGED
|
@@ -15,7 +15,24 @@ function resolveAssetsRoot() {
|
|
|
15
15
|
break;
|
|
16
16
|
dir = parent;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const xdgConfig = process.env["XDG_CONFIG_HOME"];
|
|
19
|
+
const homeDir = process.env["HOME"] ?? process.env["USERPROFILE"] ?? "";
|
|
20
|
+
const fallbackRoots = [
|
|
21
|
+
xdgConfig ? path.join(xdgConfig, "opencode") : null,
|
|
22
|
+
path.join(homeDir, ".config", "opencode"),
|
|
23
|
+
process.env["APPDATA"] ? path.join(process.env["APPDATA"], "opencode") : null,
|
|
24
|
+
process.env["LOCALAPPDATA"] ? path.join(process.env["LOCALAPPDATA"], "opencode") : null
|
|
25
|
+
].filter(Boolean);
|
|
26
|
+
for (const root of fallbackRoots) {
|
|
27
|
+
const candidate = path.join(root, "assets", "adr-init");
|
|
28
|
+
if (existsSync(candidate)) {
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
throw new Error(`assets/adr-init/ 未找到。已尝试:
|
|
33
|
+
` + ` 1. 从 ${here} 上溯 6 层
|
|
34
|
+
` + ` 2. 全局路径:${fallbackRoots.join(", ")}
|
|
35
|
+
` + `请重装 codeforge:bash install.sh --global`);
|
|
19
36
|
}
|
|
20
37
|
function isGitRepo(cwd) {
|
|
21
38
|
try {
|
package/dist/index.js
CHANGED
|
@@ -14353,7 +14353,24 @@ function resolveAssetsRoot() {
|
|
|
14353
14353
|
break;
|
|
14354
14354
|
dir = parent;
|
|
14355
14355
|
}
|
|
14356
|
-
|
|
14356
|
+
const xdgConfig = process.env["XDG_CONFIG_HOME"];
|
|
14357
|
+
const homeDir = process.env["HOME"] ?? process.env["USERPROFILE"] ?? "";
|
|
14358
|
+
const fallbackRoots = [
|
|
14359
|
+
xdgConfig ? path16.join(xdgConfig, "opencode") : null,
|
|
14360
|
+
path16.join(homeDir, ".config", "opencode"),
|
|
14361
|
+
process.env["APPDATA"] ? path16.join(process.env["APPDATA"], "opencode") : null,
|
|
14362
|
+
process.env["LOCALAPPDATA"] ? path16.join(process.env["LOCALAPPDATA"], "opencode") : null
|
|
14363
|
+
].filter(Boolean);
|
|
14364
|
+
for (const root of fallbackRoots) {
|
|
14365
|
+
const candidate = path16.join(root, "assets", "adr-init");
|
|
14366
|
+
if (existsSync4(candidate)) {
|
|
14367
|
+
return candidate;
|
|
14368
|
+
}
|
|
14369
|
+
}
|
|
14370
|
+
throw new Error(`assets/adr-init/ 未找到。已尝试:
|
|
14371
|
+
` + ` 1. 从 ${here} 上溯 6 层
|
|
14372
|
+
` + ` 2. 全局路径:${fallbackRoots.join(", ")}
|
|
14373
|
+
` + `请重装 codeforge:bash install.sh --global`);
|
|
14357
14374
|
}
|
|
14358
14375
|
function isGitRepo2(cwd) {
|
|
14359
14376
|
try {
|
|
@@ -21135,7 +21152,7 @@ import * as zlib from "node:zlib";
|
|
|
21135
21152
|
// lib/version-injected.ts
|
|
21136
21153
|
function getInjectedVersion() {
|
|
21137
21154
|
try {
|
|
21138
|
-
const v = "0.5.
|
|
21155
|
+
const v = "0.5.24";
|
|
21139
21156
|
if (typeof v === "string" && /^\d+\.\d+\.\d+/.test(v)) {
|
|
21140
21157
|
return v;
|
|
21141
21158
|
}
|