(command, opts = {})
| 48 | } |
| 49 | |
| 50 | async function cmd(command, opts = {}) { |
| 51 | command = command.trim().replace(/\s+/g, ' '); |
| 52 | |
| 53 | if (opts.verbose) console.log(`${command}`); |
| 54 | |
| 55 | const { stdout, stderr } = await asyncExec(command); |
| 56 | |
| 57 | if (stderr) { |
| 58 | console.error(`\n${stderr}`); |
| 59 | } |
| 60 | |
| 61 | return stdout.trim(); |
| 62 | } |