Skip to content

Commit 09fb203

Browse files
fix(path): respect platform PATH delimiters
1 parent 696dc61 commit 09fb203

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/config/schema.labels.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ export const FIELD_LABELS: Record<string, string> = {
8080
"gateway.auth.trustedProxy": "Gateway Trusted Proxy Auth",
8181
"gateway.trustedProxies": "Gateway Trusted Proxy CIDRs",
8282
"gateway.allowRealIpFallback": "Gateway Allow x-real-ip Fallback",
83+
"gateway.push": "Gateway Push Delivery",
84+
"gateway.push.apns": "Gateway Push APNs",
85+
"gateway.push.apns.relay": "Gateway Push APNs Relay",
86+
"gateway.push.apns.relay.baseUrl": "Gateway Push APNs Relay Base URL",
87+
"gateway.push.apns.relay.timeoutMs": "Gateway Push APNs Relay Timeout (ms)",
8388
"gateway.tools": "Gateway Tool Exposure Policy",
8489
"gateway.tools.allow": "Gateway Tool Allowlist",
8590
"gateway.tools.deny": "Gateway Tool Denylist",

src/infra/path-env.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ function isDirectory(dirPath: string): boolean {
3030
}
3131
}
3232

33-
function mergePath(params: { existing: string; prepend?: string[]; append?: string[] }): string {
33+
function mergePath(params: {
34+
existing: string;
35+
prepend?: string[];
36+
append?: string[];
37+
delimiter?: string;
38+
}): string {
39+
const delimiter = params.delimiter ?? path.delimiter;
3440
const partsExisting = params.existing
35-
.split(path.delimiter)
41+
.split(delimiter)
3642
.map((part) => part.trim())
3743
.filter(Boolean);
3844
const partsPrepend = (params.prepend ?? []).map((part) => part.trim()).filter(Boolean);
@@ -46,7 +52,7 @@ function mergePath(params: { existing: string; prepend?: string[]; append?: stri
4652
merged.push(part);
4753
}
4854
}
49-
return merged.join(path.delimiter);
55+
return merged.join(delimiter);
5056
}
5157

5258
function candidateBinDirs(opts: EnsureOpenClawPathOpts): { prepend: string[]; append: string[] } {
@@ -142,12 +148,13 @@ export function ensureOpenClawCliOnPath(opts: EnsureOpenClawPathOpts = {}) {
142148
process.env.OPENCLAW_PATH_BOOTSTRAPPED = "1";
143149

144150
const existing = opts.pathEnv ?? process.env.PATH ?? "";
151+
const delimiter = (opts.platform ?? process.platform) === "win32" ? ";" : path.delimiter;
145152
const { prepend, append } = candidateBinDirs(opts);
146153
if (prepend.length === 0 && append.length === 0) {
147154
return;
148155
}
149156

150-
const merged = mergePath({ existing, prepend, append });
157+
const merged = mergePath({ existing, prepend, append, delimiter });
151158
if (merged) {
152159
process.env.PATH = merged;
153160
}

0 commit comments

Comments
 (0)