(command, args, options = {})
| 97 | } |
| 98 | |
| 99 | function spawnProcess(command, args, options = {}) { |
| 100 | const child = spawn( |
| 101 | command, |
| 102 | args, |
| 103 | getProcessTreeSpawnOptions({ |
| 104 | stdio: "inherit", |
| 105 | ...options, |
| 106 | }), |
| 107 | ); |
| 108 | |
| 109 | child.once("error", (error) => { |
| 110 | if (isEnoentError(error) && command === "uvx") { |
| 111 | console.error(formatMissingUvxGuidance(options?.cwd)); |
| 112 | } else if (isEnoentError(error)) { |
| 113 | console.error( |
| 114 | `Failed to start ${command}. Make sure it is installed and on your PATH.`, |
| 115 | ); |
| 116 | } else { |
| 117 | console.error(`Failed to start ${command}:`, error); |
| 118 | } |
| 119 | }); |
| 120 | |
| 121 | return child; |
| 122 | } |
| 123 | |
| 124 | async function main() { |
| 125 | const config = buildExtraBackendConfig(); |
no test coverage detected