nested-input-inherit.js
This file
Path
test/fixtures/nested-input-inherit.js
14 lines · 483 bytes · JavaScript
Last changed by
TweaksSindre Sorhusbefore adoption698a1b8
History of this fileTake it
Fix input with inherited stdin (#1232)Puneet Dixitbefore adoption3ed0544
lines 1–10why, one step back1#!/usr/bin/env node2import process from 'node:process';3import {execa, execaSync} from '../../index.js';4import {foobarString} from '../helpers/input.js';56const [optionName, stdioOptionString, isSyncString] = process.argv.slice(2);7const execaMethod = isSyncString === 'true' ? execaSync : execa;8const options = {9 input: foobarString,10 [optionName]: JSON.parse(stdioOptionString),TweaksSindre Sorhusbefore adoption698a1b8
line 11why, one step back11 ...((optionName === 'stdin') && {stdout: 'inherit'}),Fix input with inherited stdin (#1232)Puneet Dixitbefore adoption3ed0544
lines 12–14why, one step back12};1314await execaMethod('stdin.js', options);