(command: string)
| 19 | |
| 20 | // Run the specified shell command |
| 21 | function runCommand(command: string) { |
| 22 | return new Promise((resolve, reject) => { |
| 23 | const childProcess = exec(command, (error, stdout, stderr) => { |
| 24 | if (error) { |
| 25 | reject(error) |
| 26 | } |
| 27 | resolve(stdout || stderr) |
| 28 | }) |
| 29 | childProcess.stdout?.pipe(process.stdout) |
| 30 | childProcess.stderr?.pipe(process.stderr) |
| 31 | }) |
| 32 | } |
| 33 | |
| 34 | async function main() { |
| 35 | // Ask questions and process answers |