(cmd: string[], opts: RunOptions = {})
| 163 | } |
| 164 | |
| 165 | export async function text(cmd: string[], opts: RunOptions = {}): Promise<TextResult> { |
| 166 | const out = await run(cmd, opts) |
| 167 | return { |
| 168 | ...out, |
| 169 | text: out.stdout.toString(), |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | export async function lines(cmd: string[], opts: RunOptions = {}): Promise<string[]> { |
| 174 | return (await text(cmd, opts)).text.split(/\r?\n/).filter(Boolean) |