(command, args, options)
| 125 | } |
| 126 | |
| 127 | function spawnAsync(command, args, options) { |
| 128 | return new Promise((resolve, reject) => { |
| 129 | const mergedOptions = { |
| 130 | stdio: "inherit", |
| 131 | ...options, |
| 132 | env: options?.env ? buildSpawnEnv(options.env) : options?.env, |
| 133 | }; |
| 134 | const useLocalCordova = command === "cordova" && fs.existsSync(CORDOVA_BIN); |
| 135 | const proc = useLocalCordova |
| 136 | ? spawn(process.execPath, [CORDOVA_BIN, ...args], mergedOptions) |
| 137 | : spawn(resolveSpawnCommand(command), args, mergedOptions); |
| 138 | proc.on("close", (code) => { |
| 139 | if (code === 0) resolve(); |
| 140 | else reject(new Error(`${command} exited with code ${code}`)); |
| 141 | }); |
| 142 | proc.on("error", reject); |
| 143 | }); |
| 144 | } |
| 145 | |
| 146 | // ─── self-signed certificate ───────────────────────────────────────────────── |
| 147 |
no test coverage detected