(command: string, cwd: string)
| 79 | const shellTokens = (command: string) => command.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) ?? [] |
| 80 | const unquote = (value: string) => value.replace(/^(['"])(.*)\1$/, "$2") |
| 81 | const externalCommandDirectories = (command: string, cwd: string) => { |
| 82 | const directories = new Set<string>() |
| 83 | for (const token of shellTokens(command)) { |
| 84 | const value = unquote(token).replace(/[;,|&]+$/, "") |
| 85 | if (!path.isAbsolute(value)) continue |
| 86 | const resolved = FSUtil.resolve(value) |
| 87 | if (FSUtil.contains(cwd, resolved)) continue |
| 88 | directories.add(FSUtil.resolve(path.dirname(resolved))) |
| 89 | } |
| 90 | return [...directories] |
| 91 | } |
| 92 | |
| 93 | const layer = Layer.effectDiscard( |
| 94 | Effect.gen(function* () { |
no test coverage detected