()
| 61 | return this.raw.exitCode !== null; |
| 62 | } |
| 63 | public async waitUntilDone(): Promise<ProcResult> { |
| 64 | if (this.result) { |
| 65 | return this.result; |
| 66 | } |
| 67 | while (this.raw.exitCode === null) { |
| 68 | await sleep(10); // milliseconds |
| 69 | } |
| 70 | this.result = { |
| 71 | exitCode: this.raw.exitCode, |
| 72 | stdout: this.output.stdout |
| 73 | }; |
| 74 | return this.result; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | export function spawn(executable: string, ...args: string[]) { |