test: simplify bash exec path normalization · openclaw/openclaw@71816a3
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -118,11 +118,16 @@ const normalizeText = (value?: string) =>
|
118 | 118 | .replace(/\r/g, "\n") |
119 | 119 | .trim(); |
120 | 120 | |
121 | | -const normalizePathEntries = (value?: string) => |
122 | | -normalizeText(value) |
123 | | -.split(/[:\s]+/) |
124 | | -.map((entry) => entry.trim()) |
125 | | -.filter(Boolean); |
| 121 | +function normalizePathEntries(value?: string): string[] { |
| 122 | +const entries: string[] = []; |
| 123 | +for (const entry of normalizeText(value).split(/[:\s]+/)) { |
| 124 | +const normalized = entry.trim(); |
| 125 | +if (normalized.length > 0) { |
| 126 | +entries.push(normalized); |
| 127 | +} |
| 128 | +} |
| 129 | +return entries; |
| 130 | +} |
126 | 131 | |
127 | 132 | describe("exec PATH login shell merge", () => { |
128 | 133 | let envSnapshot: ReturnType<typeof captureEnv>; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。