(rawFile, rawArguments, rawOptions, createNested)
| 25 | |
| 26 | // Main shared logic for all async methods: `execa()`, `$`, `execaNode()` |
| 27 | export const execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => { |
| 28 | const {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleAsyncArguments(rawFile, rawArguments, rawOptions); |
| 29 | const {subprocess: nodeChildProcess, promise, kill, all, convertedStreams} = spawnSubprocessAsync({ |
| 30 | file, |
| 31 | commandArguments, |
| 32 | options, |
| 33 | startTime, |
| 34 | verboseInfo, |
| 35 | command, |
| 36 | escapedCommand, |
| 37 | fileDescriptors, |
| 38 | }); |
| 39 | const subprocess = getSubprocessPromise({ |
| 40 | promise, |
| 41 | nodeChildProcess, |
| 42 | kill, |
| 43 | all, |
| 44 | convertedStreams, |
| 45 | options, |
| 46 | }); |
| 47 | subprocess.pipe = pipeToSubprocess.bind(undefined, { |
| 48 | source: subprocess, |
| 49 | sourcePromise: promise, |
| 50 | boundOptions: {}, |
| 51 | createNested, |
| 52 | }); |
| 53 | SUBPROCESS_OPTIONS.set(subprocess, {options, fileDescriptors}); |
| 54 | return subprocess; |
| 55 | }; |
| 56 | |
| 57 | // Compute arguments to pass to `child_process.spawn()` |
| 58 | const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => { |
no test coverage detected