MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / prependPathEntries

Function prependPathEntries

apps/cli/src/main.ts:12–16  ·  view source on GitHub ↗
(entries: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

10// still find them.
11const execDir = dirname(process.execPath);
12const prependPathEntries = (entries: ReadonlyArray<string>): void => {
13 const current = process.env.PATH?.split(delimiter).filter(Boolean) ?? [];
14 const next = [...entries.filter((entry) => !current.includes(entry)), ...current];
15 process.env.PATH = next.join(delimiter);
16};
17prependPathEntries([
18 execDir,
19 ...(process.platform === "darwin" ? ["/opt/homebrew/bin", "/usr/local/bin"] : []),

Callers 1

main.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected