(output: string)
| 32 | |
| 33 | /** Extract the value of the `PATH=` line from `env`-style shell output. */ |
| 34 | export function parseShellPathOutput(output: string): string | null { |
| 35 | if (!output) return null; |
| 36 | for (const line of output.split("\n")) { |
| 37 | if (line.startsWith("PATH=")) { |
| 38 | return line.slice("PATH=".length).trim() || null; |
| 39 | } |
| 40 | } |
| 41 | return null; |
| 42 | } |
| 43 | |
| 44 | export interface LoginShellPathOptions { |
| 45 | platform?: NodeJS.Platform; |
no outgoing calls
no test coverage detected