nested-pipe-subprocess.js
This file
Path
test/fixtures/nested-pipe-subprocess.js
16 lines · 477 bytes · JavaScript
Last changed by
Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
History of this fileTake it
1234567891011121314151617#!/usr/bin/env nodeimport {execa, getOneMessage} from '../../index.js';
const {file, commandArguments, options: {unpipe, ...options}} = await getOneMessage();const source = execa(file, commandArguments, options);const destination = execa('stdin.js');const controller = new AbortController();const subprocess = source.pipe(destination, {unpipeSignal: controller.signal});if (unpipe) { controller.abort(); destination.stdin.end();}
try { await subprocess;} catch {}