11import process from 'process'
22
3- import { execa , ExecaChildProcess , execaCommand , Options } from 'execa'
3+ import { execa , ExecaChildProcess , execaCommand , Options , CommonOptions } from 'execa'
44
55/** Allow running local binaries by default */
6- const DEFAULT_OPTIONS : Partial < Options < string > > = { preferLocal : true }
6+ const DEFAULT_OPTIONS : Partial < CommonOptions > = { preferLocal : true }
77
88/** Run a command, with arguments being an array */
9- export const run = ( file : string , args ?: string [ ] | object , options ?: Record < string , unknown > ) => {
9+ export const run = ( file : string , args ?: string [ ] | object , options ?: Options ) => {
1010 const [ argsA , optionsA ] = parseArgs ( args , options )
1111 const optionsB = { ...DEFAULT_OPTIONS , ...optionsA }
1212 const childProcess = execa ( file , argsA , optionsB )
@@ -15,9 +15,9 @@ export const run = (file: string, args?: string[] | object, options?: Record<str
1515}
1616
1717/** Run a command, with file + arguments being a single string */
18- export const runCommand = ( command : string , options : Options < string > ) => {
18+ export const runCommand = ( command : string , options : Options ) => {
1919 const optionsA = { ...DEFAULT_OPTIONS , ...options }
20- const childProcess = execaCommand ( command , optionsA )
20+ const childProcess = execaCommand ( command , options )
2121 redirectOutput ( childProcess , optionsA )
2222 return childProcess
2323}
@@ -38,7 +38,7 @@ const parseArgs = function (args, options) {
3838/**
3939 * Redirect output by default, unless specified otherwise
4040 * */
41- const redirectOutput = ( childProcess : ExecaChildProcess < string > , options : Options < string > ) => {
41+ const redirectOutput = ( childProcess : ExecaChildProcess < string > , options : CommonOptions ) => {
4242 if ( options . stdio !== undefined || options . stdout !== undefined || options . stderr !== undefined ) {
4343 return
4444 }
0 commit comments