diff --git a/dist/index.js b/dist/index.js index 371b043..016158c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -361,7 +361,11 @@ class DotnetCoreInstaller { : DotnetCoreInstaller.installationDirectoryMac); } } - const { exitCode, stdout } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, { ignoreReturnCode: true }); + const getExecOutputOptions = { + ignoreReturnCode: true, + env: process.env + }; + const { exitCode, stdout } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); if (exitCode) { throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`); } diff --git a/src/installer.ts b/src/installer.ts index 56869fa..6a7702e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -244,10 +244,15 @@ export class DotnetCoreInstaller { ); } } + + const getExecOutputOptions = { + ignoreReturnCode: true, + env: process.env as {string: string} + }; const {exitCode, stdout} = await exec.getExecOutput( `"${scriptPath}"`, scriptArguments, - {ignoreReturnCode: true} + getExecOutputOptions ); if (exitCode) { throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`);