index.js
This file
Path
index.js
355 lines · 8.9 KiB · JavaScript
Last changed by
Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881
History of this fileTake it
The walk stopped after 200 commits: lines older than 408904b point at it.
Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
lines 1–4why, one step back1import {Buffer} from 'node:buffer';2import path from 'node:path';3import childProcess from 'node:child_process';4import process from 'node:process';Allow the first argument of `execa()` to be a file URL (#631)ehmickybefore adoption3bbd8ae
line 5why, one step back5import {fileURLToPath} from 'node:url';Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
lines 6–9why, one step back6import crossSpawn from 'cross-spawn';7import stripFinalNewline from 'strip-final-newline';8import {npmRunPathEnv} from 'npm-run-path';9import {makeError} from './lib/error.js';Refactor `stdio` options (#623)ehmickybefore adoption2d76897
lines 10–12why, one step back10import {handleInputAsync, pipeOutputAsync} from './lib/stdio/async.js';11import {handleInputSync, pipeOutputSync} from './lib/stdio/sync.js';12import {normalizeStdioNode} from './lib/stdio/normalize.js';Rename `forceKillAfterTimeout` to `forceKillAfterDelay` (#723)ehmickybefore adoption0ff8b34
line 13why, one step back13import {spawnedKill, validateTimeout, normalizeForceKillAfterDelay} from './lib/kill.js';Add `pipeStdout()`-related methods (#531)ehmickybefore adoption06287c8
line 14why, one step back14import {addPipeMethods} from './lib/pipe.js';Handle `inputFile` missing file (#609)ehmickybefore adoption8638ce7
line 15why, one step back15import {getSpawnedResult, makeAllStream} from './lib/stream.js';Use `async/await` instead of direct `Promise` manipulation (#659)ehmickybefore adoption7122767
line 16why, one step back16import {mergePromise} from './lib/promise.js';Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
line 17why, one step back17import {joinCommand, parseCommand, parseTemplates, getEscapedCommand} from './lib/command.js';Add `verbose` option (#532)ehmickybefore adoption69ce814
line 18why, one step back18import {logCommand, verboseDefault} from './lib/verbose.js';Validate `input` option's type (#668)ehmickybefore adoption65742c6
line 19why, one step back19import {bufferToUint8Array} from './lib/stdio/utils.js';Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 20–26why, one step back2021const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;2223const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {24 const env = extendEnv ? {...process.env, ...envOption} : envOption;2526 if (preferLocal) {Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 27why, one step back27 return npmRunPathEnv({env, cwd: localDir, execPath});Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 28–32why, one step back28 }2930 return env;31};32Allow `shell` option to be a file URL (#635)ehmickybefore adoption189d486
lines 33–34why, one step back33const normalizeFileUrl = file => file instanceof URL ? fileURLToPath(file) : file;34Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
lines 35–36why, one step back35const getFilePath = rawFile => {36 const fileString = normalizeFileUrl(rawFile);Allow the first argument of `execa()` to be a file URL (#631)ehmickybefore adoption3bbd8ae
line 37why, one step back37Allow `shell` option to be a file URL (#635)ehmickybefore adoption189d486
line 38why, one step back38 if (typeof fileString !== 'string') {Allow the first argument of `execa()` to be a file URL (#631)ehmickybefore adoption3bbd8ae
lines 39–41why, one step back39 throw new TypeError('First argument must be a string or a file URL.');40 }41Allow `shell` option to be a file URL (#635)ehmickybefore adoption189d486
line 42why, one step back42 return fileString;Allow the first argument of `execa()` to be a file URL (#631)ehmickybefore adoption3bbd8ae
lines 43–44why, one step back43};44Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
lines 45–48why, one step back45const handleArguments = (rawFile, rawArgs, rawOptions = {}) => {46 const filePath = getFilePath(rawFile);47 const command = joinCommand(filePath, rawArgs);48 const escapedCommand = getEscapedCommand(filePath, rawArgs);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 49why, one step back49Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
lines 50–51why, one step back50 const {command: file, args, options: initialOptions} = crossSpawn._parse(filePath, rawArgs, rawOptions);51Fix passing `undefined` options (#712)ehmickybefore adoption472c065
line 52why, one step back52 const options = addDefaultOptions(initialOptions);Improve `timeout` option validation (#715)ehmickybefore adoption0fbd3a2
line 53why, one step back53 validateTimeout(options);Fix passing `undefined` options (#712)ehmickybefore adoption472c065
line 54why, one step back54 options.shell = normalizeFileUrl(options.shell);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 55why, one step back55 options.env = getEnv(options);Rename `forceKillAfterTimeout` to `forceKillAfterDelay` (#723)ehmickybefore adoption0ff8b34
line 56why, one step back56 options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 57–62why, one step back5758 if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {59 // #11660 args.unshift('/q');61 }62Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
lines 63–65why, one step back63 logCommand(escapedCommand, options);6465 return {file, args, command, escapedCommand, options};Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 66why, one step back66};Fix passing `undefined` options (#712)ehmickybefore adoption472c065
lines 67–83why, one step back6768const addDefaultOptions = ({69 maxBuffer = DEFAULT_MAX_BUFFER,70 buffer = true,71 stripFinalNewline = true,72 extendEnv = true,73 preferLocal = false,74 cwd = process.cwd(),75 localDir = cwd,76 execPath = process.execPath,77 encoding = 'utf8',78 reject = true,79 cleanup = true,80 all = false,81 windowsHide = true,82 verbose = verboseDefault,83 killSignal = 'SIGTERM',Rename `forceKillAfterTimeout` to `forceKillAfterDelay` (#723)ehmickybefore adoption0ff8b34
line 84why, one step back84 forceKillAfterDelay = true,Fix passing `undefined` options (#712)ehmickybefore adoption472c065
lines 85–102why, one step back85 ...options86}) => ({87 ...options,88 maxBuffer,89 buffer,90 stripFinalNewline,91 extendEnv,92 preferLocal,93 cwd,94 localDir,95 execPath,96 encoding,97 reject,98 cleanup,99 all,100 windowsHide,101 verbose,102 killSignal,Rename `forceKillAfterTimeout` to `forceKillAfterDelay` (#723)ehmickybefore adoption0ff8b34
line 103why, one step back103 forceKillAfterDelay,Fix passing `undefined` options (#712)ehmickybefore adoption472c065
line 104why, one step back104});Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 105why, one step back105Fix `timeout` option (#727)ehmickybefore adoptiona61a028
lines 106–108why, one step back106// Prevent passing the `timeout` option directly to `child_process.spawn()`107const handleAsyncOptions = ({timeout, ...options}) => ({...options, timeoutDuration: timeout});108Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 109why, one step back109const handleOutput = (options, value) => {Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe
line 110why, one step back110 if (value === undefined || value === null) {Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 111why, one step back111 return;Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 112–113why, one step back112 }113Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 114–117why, one step back114 if (Array.isArray(value)) {115 return value;116 }117Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
lines 118–119why, one step back118 if (Buffer.isBuffer(value)) {119 value = bufferToUint8Array(value);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 120–121why, one step back120 }121Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 122why, one step back122 return options.stripFinalNewline ? stripFinalNewline(value) : value;Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 123–124why, one step back123};124Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 125why, one step back125export function execa(rawFile, rawArgs, rawOptions) {Fix `timeout` option (#727)ehmickybefore adoptiona61a028
lines 126–127why, one step back126 const {file, args, command, escapedCommand, options: normalizedOptions} = handleArguments(rawFile, rawArgs, rawOptions);127 const options = handleAsyncOptions(normalizedOptions);Handle `inputFile` missing file (#609)ehmickybefore adoption8638ce7
line 128why, one step back128Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
line 129why, one step back129 const stdioStreamsGroups = handleInputAsync(options);Fix `timeout` option validation (#463)ehmickybefore adoption427c5c2
line 130why, one step back130Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 131–132why, one step back131 let spawned;132 try {Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 133why, one step back133 spawned = childProcess.spawn(file, args, options);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 134–136why, one step back134 } catch (error) {135 // Ensure the returned error is always both a promise and a child process136 const dummySpawned = new childProcess.ChildProcess();Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881
line 137why, one step back137 const errorInstance = makeError({Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 138why, one step back138 error,Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
line 139why, one step back139 stdio: Array.from({length: stdioStreamsGroups.length}),Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 140why, one step back140 command,Add `.escapedCommand` property (#466)ehmickybefore adoption712bafc
line 141why, one step back141 escapedCommand,Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 142why, one step back142 options,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 143–144why, one step back143 timedOut: false,144 isCanceled: false,Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881
lines 145–146why, one step back145 });146 const errorPromise = options.reject ? Promise.reject(errorInstance) : Promise.resolve(errorInstance);Add `pipeStdout()`-related methods (#531)ehmickybefore adoption06287c8
lines 147–148why, one step back147 mergePromise(dummySpawned, errorPromise);148 return dummySpawned;Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 149–150why, one step back149 }150Improve graceful exit (#714)ehmickybefore adoption5eeaab5
lines 151–152why, one step back151 const controller = new AbortController();152Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
lines 153–154why, one step back153 pipeOutputAsync(spawned, stdioStreamsGroups);154Improve graceful exit (#714)ehmickybefore adoption5eeaab5
line 155why, one step back155 spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned), options, controller);Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
line 156why, one step back156 spawned.all = makeAllStream(spawned, options);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 157why, one step back157Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
line 158why, one step back158 addPipeMethods(spawned);Fix unhandled rejections and missing data (#658)ehmickybefore adoption20b2ee6
line 159why, one step back159Improve graceful exit (#714)ehmickybefore adoption5eeaab5
line 160why, one step back160 const promise = handlePromise({spawned, options, stdioStreamsGroups, command, escapedCommand, controller});Fix unhandled rejections and missing data (#658)ehmickybefore adoption20b2ee6
line 161why, one step back161 mergePromise(spawned, promise);Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 162–163why, one step back162 return spawned;163}Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 164why, one step back164Improve graceful exit (#714)ehmickybefore adoption5eeaab5
line 165why, one step back165const handlePromise = async ({spawned, options, stdioStreamsGroups, command, escapedCommand, controller}) => {Remove `.cancel()` method (#711)ehmickybefore adoption16e5fd6
lines 166–167why, one step back166 const context = {timedOut: false};167Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
line 168why, one step back168 const [Improve process termination (#724)ehmickybefore adoption1c48d37
lines 169–170why, one step back169 error,170 [, exitCode, signal],Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 171why, one step back171 stdioResults,Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
line 172why, one step back172 allResult,Improve graceful exit (#714)ehmickybefore adoption5eeaab5
line 173why, one step back173 ] = await getSpawnedResult({spawned, options, context, stdioStreamsGroups, controller});Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 174why, one step back174 const stdio = stdioResults.map(stdioResult => handleOutput(options, stdioResult));Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 175–177why, one step back175 const all = handleOutput(options, allResult);176177 if (error || exitCode !== 0 || signal !== null) {Remove `.cancel()` method (#711)ehmickybefore adoption16e5fd6
line 178why, one step back178 const isCanceled = options.signal?.aborted === true;Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 179–182why, one step back179 const returnedError = makeError({180 error,181 exitCode,182 signal,Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 183why, one step back183 stdio,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 184why, one step back184 all,Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 185–187why, one step back185 command,186 escapedCommand,187 options,Use `async/await` instead of direct `Promise` manipulation (#659)ehmickybefore adoption7122767
line 188why, one step back188 timedOut: context.timedOut,Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 189–190why, one step back189 isCanceled,190 });Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 191why, one step back191Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 192–194why, one step back192 if (!options.reject) {193 return returnedError;194 }Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 195why, one step back195Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 196–197why, one step back196 throw returnedError;197 }Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 198why, one step back198Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 199–202why, one step back199 return {200 command,201 escapedCommand,202 exitCode: 0,Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
lines 203–205why, one step back203 stdio,204 stdout: stdio[1],205 stderr: stdio[2],Refactoring: move inner function to outer scope (#654)ehmickybefore adoptiond78348d
lines 206–212why, one step back206 all,207 failed: false,208 timedOut: false,209 isCanceled: false,210 isTerminated: false,211 };212};Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 213why, one step back213Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
lines 214–215why, one step back214export function execaSync(rawFile, rawArgs, rawOptions) {215 const {file, args, command, escapedCommand, options} = handleArguments(rawFile, rawArgs, rawOptions);Handle `inputFile` missing file (#609)ehmickybefore adoption8638ce7
line 216why, one step back216Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
line 217why, one step back217 const stdioStreamsGroups = handleInputSync(options);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 218–220why, one step back218219 let result;220 try {Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 221why, one step back221 result = childProcess.spawnSync(file, args, options);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 222why, one step back222 } catch (error) {Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881
line 223why, one step back223 const errorInstance = makeError({Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 224why, one step back224 error,Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
line 225why, one step back225 stdio: Array.from({length: stdioStreamsGroups.stdioLength}),Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 226why, one step back226 command,Add `.escapedCommand` property (#466)ehmickybefore adoption712bafc
line 227why, one step back227 escapedCommand,Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 228why, one step back228 options,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 229–231why, one step back229 timedOut: false,230 isCanceled: false,231 });Fix `reject` option with early spawning errors (#734)ehmickybefore adoption8a18881
lines 232–237why, one step back232233 if (!options.reject) {234 return errorInstance;235 }236237 throw errorInstance;Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 238–239why, one step back238 }239Simplify `std*` options logic (#691)ehmickybefore adoption98b0ee3
line 240why, one step back240 pipeOutputSync(stdioStreamsGroups, result);Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 241why, one step back241Fix inconsistency between `result.stdout` and `error.stdout` (#686)ehmickybefore adoptionec383fe
line 242why, one step back242 const output = result.output || Array.from({length: 3});Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
lines 243–244why, one step back243 const stdio = output.map(stdioOutput => handleOutput(options, stdioOutput));244Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 245–246why, one step back245 if (result.error || result.status !== 0 || result.signal !== null) {246 const error = makeError({Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 247why, one step back247 stdio,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 248–251why, one step back248 error: result.error,249 signal: result.signal,250 exitCode: result.status,251 command,Add `.escapedCommand` property (#466)ehmickybefore adoption712bafc
line 252why, one step back252 escapedCommand,Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 253why, one step back253 options,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 254–257why, one step back254 timedOut: result.error && result.error.code === 'ETIMEDOUT',255 isCanceled: false,256 });257Refactor duplicate code between `execa()` and `execaSync()` (#648)ehmickybefore adoption4fb84f0
line 258why, one step back258 if (!options.reject) {Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 259–266why, one step back259 return error;260 }261262 throw error;263 }264265 return {266 command,Add `.escapedCommand` property (#466)ehmickybefore adoption712bafc
line 267why, one step back267 escapedCommand,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 268why, one step back268 exitCode: 0,Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
lines 269–271why, one step back269 stdio,270 stdout: stdio[1],271 stderr: stdio[2],Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 272–274why, one step back272 failed: false,273 timedOut: false,274 isCanceled: false,Fix `error.killed` and rename to `error.isTerminated` (#625)ehmickybefore adoption248349c
line 275why, one step back275 isTerminated: false,Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 276why, one step back276 };Minor tweaksSindre Sorhusbefore adoption244e87a
line 277why, one step back277}Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
line 278why, one step back278Fix default value of `stdin` with `$` (#550)ehmickybefore adoption6fe7e51
lines 279–288why, one step back279const normalizeScriptStdin = ({input, inputFile, stdio}) => input === undefined && inputFile === undefined && stdio === undefined280 ? {stdin: 'inherit'}281 : {};282283const normalizeScriptOptions = (options = {}) => ({284 preferLocal: true,285 ...normalizeScriptStdin(options),286 ...options,287});288Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
lines 289–290why, one step back289function create$(options) {290 function $(templatesOrOptions, ...expressions) {Improve validation of `$.sync` options binding (#551)ehmickybefore adoption881fbad
lines 291–292why, one step back291 if (!Array.isArray(templatesOrOptions)) {292 return create$({...options, ...templatesOrOptions});Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
lines 293–294why, one step back293 }294Improve validation of `$.sync` options binding (#551)ehmickybefore adoption881fbad
line 295why, one step back295 const [file, ...args] = parseTemplates(templatesOrOptions, expressions);Fix default value of `stdin` with `$` (#550)ehmickybefore adoption6fe7e51
line 296why, one step back296 return execa(file, args, normalizeScriptOptions(options));Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
lines 297–299why, one step back297 }298299 $.sync = (templates, ...expressions) => {Improve validation of `$.sync` options binding (#551)ehmickybefore adoption881fbad
lines 300–303why, one step back300 if (!Array.isArray(templates)) {301 throw new TypeError('Please use $(options).sync`command` instead of $.sync(options)`command`.');302 }303Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
line 304why, one step back304 const [file, ...args] = parseTemplates(templates, expressions);Fix default value of `stdin` with `$` (#550)ehmickybefore adoption6fe7e51
line 305why, one step back305 return execaSync(file, args, normalizeScriptOptions(options));Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
lines 306–307why, one step back306 };307Add `$.s` as an alias for `$.sync` (#594)ehmickybefore adoptionb719fb0
lines 308–309why, one step back308 $.s = $.sync;309Add `$` tagged templates API (#510)Aaron Casanovabefore adoptioneae327c
lines 310–312why, one step back310 return $;311}312Fix default value of `stdin` with `$` (#550)ehmickybefore adoption6fe7e51
line 313why, one step back313export const $ = create$();Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 314why, one step back314Minor tweaksSindre Sorhusbefore adoption244e87a
line 315why, one step back315export function execaCommand(command, options) {Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 316–317why, one step back316 const [file, ...args] = parseCommand(command);317 return execa(file, args, options);Minor tweaksSindre Sorhusbefore adoption244e87a
line 318why, one step back318}Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 319why, one step back319Minor tweaksSindre Sorhusbefore adoption244e87a
line 320why, one step back320export function execaCommandSync(command, options) {Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 321why, one step back321 const [file, ...args] = parseCommand(command);Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 322why, one step back322 return execaSync(file, args, options);Minor tweaksSindre Sorhusbefore adoption244e87a
line 323why, one step back323}Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 324why, one step back324Minor tweaksSindre Sorhusbefore adoption244e87a
line 325why, one step back325export function execaNode(scriptPath, args, options = {}) {Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 326–330why, one step back326 if (args && !Array.isArray(args) && typeof args === 'object') {327 options = args;328 args = [];329 }330Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 331why, one step back331 const stdio = normalizeStdioNode(options);Remove `--inspect` & `--inspect-brk` from `execArgv` (#435)Ward Peetersbefore adoption8fd3f64
line 332why, one step back332 const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 333why, one step back333Remove `--inspect` & `--inspect-brk` from `execArgv` (#435)Ward Peetersbefore adoption8fd3f64
lines 334–335why, one step back334 const {335 nodePath = process.execPath,Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 336why, one step back336 nodeOptions = defaultExecArgv,Remove `--inspect` & `--inspect-brk` from `execArgv` (#435)Ward Peetersbefore adoption8fd3f64
line 337why, one step back337 } = options;Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 338–342why, one step back338339 return execa(340 nodePath,341 [342 ...nodeOptions,Allow the first argument of `execa()` to be a file URL (#631)ehmickybefore adoption3bbd8ae
line 343why, one step back343 getFilePath(scriptPath),Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 344why, one step back344 ...(Array.isArray(args) ? args : []),Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
lines 345–351why, one step back345 ],346 {347 ...options,348 stdin: undefined,349 stdout: undefined,350 stderr: undefined,351 stdio,Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
lines 352–353why, one step back352 shell: false,353 },Clean up outdated code in tests (#405)fisker Cheungbefore adoption408904b
line 354why, one step back354 );Minor tweaksSindre Sorhusbefore adoption244e87a
line 355why, one step back355}