@@ -86,6 +86,7 @@ export type ProcessConfig = {
8686 command : string ;
8787 args ?: string [ ] ;
8888 cwd ?: string ;
89+ env ?: Record < string , string > ;
8990 observer ?: ProcessObserver ;
9091 ignoreExitCode ?: boolean ;
9192} ;
@@ -138,7 +139,7 @@ export type ProcessObserver = {
138139 * @param cfg - see {@link ProcessConfig}
139140 */
140141export function executeProcess ( cfg : ProcessConfig ) : Promise < ProcessResult > {
141- const { observer, cwd, command, args, ignoreExitCode = false } = cfg ;
142+ const { observer, cwd, command, args, ignoreExitCode = false , env } = cfg ;
142143 const { onStdout, onError, onComplete } = observer ?? { } ;
143144 const date = new Date ( ) . toISOString ( ) ;
144145 const start = performance . now ( ) ;
@@ -152,7 +153,7 @@ export function executeProcess(cfg: ProcessConfig): Promise<ProcessResult> {
152153
153154 return new Promise ( ( resolve , reject ) => {
154155 // shell:true tells Windows to use shell command for spawning a child process
155- const process = spawn ( command , args , { cwd, shell : true } ) ;
156+ const process = spawn ( command , args , { cwd, shell : true , env } ) ;
156157 // eslint-disable-next-line functional/no-let
157158 let stdout = '' ;
158159 // eslint-disable-next-line functional/no-let
0 commit comments