(command, args, options = {})
| 45 | } |
| 46 | |
| 47 | export async function tryRun(command, args, options = {}) { |
| 48 | const exec = commandForExecFile(command, args); |
| 49 | try { |
| 50 | await execFileAsync(exec.command, exec.args, { |
| 51 | cwd: appRoot, |
| 52 | maxBuffer: 1024 * 1024 * 16, |
| 53 | ...exec.options, |
| 54 | }); |
| 55 | } catch (error) { |
| 56 | const details = [error.stdout?.trim(), error.stderr?.trim(), error.message] |
| 57 | .filter(Boolean) |
| 58 | .join('\n'); |
| 59 | console.warn(`Warning: ${basename(command)} ${args.join(' ')} failed.\n${details}`); |
| 60 | } |
| 61 | } |
no test coverage detected