(command, binPath, args)
| 35 | } |
| 36 | |
| 37 | function run(command, binPath, args) { |
| 38 | return new Promise((resolve, reject) => { |
| 39 | const child = spawn(process.execPath, [binPath, ...args], { |
| 40 | cwd: packageRoot, |
| 41 | stdio: 'inherit', |
| 42 | }); |
| 43 | |
| 44 | child.once('error', reject); |
| 45 | child.once('exit', (code, signal) => { |
| 46 | if (code === 0) { |
| 47 | resolve(); |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | const detail = signal === null ? `exit code ${String(code)}` : `signal ${signal}`; |
| 52 | reject(new Error(`${command} failed with ${detail}`)); |
| 53 | }); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | async function writeProviderClientShim() { |
| 58 | await mkdir(dtsRoot, { recursive: true }); |
no test coverage detected