diff --git a/dist/index.js b/dist/index.js index 2bbacc8..4f015b2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11111,7 +11111,9 @@ async function choco(tool, version) { '-m', '--no-progress', '-r' - ]); + ], { + ignoreReturnCode: true + }); } async function ghcupBin(os) { const v = '0.1.8'; @@ -11125,8 +11127,10 @@ async function ghcupBin(os) { async function ghcup(tool, version, os) { core.info(`Attempting to install ${tool} ${version} using ghcup`); const bin = await ghcupBin(os); - await exec_1.exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version]); - if (tool === 'ghc') + const returnCode = await exec_1.exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version], { + ignoreReturnCode: true + }); + if (returnCode === 0 && tool === 'ghc') await exec_1.exec(bin, ['set', version]); } diff --git a/src/installer.ts b/src/installer.ts index d71c42f..e7b47f8 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -170,16 +170,22 @@ async function apt(tool: Tool, version: string): Promise { async function choco(tool: Tool, version: string): Promise { core.info(`Attempting to install ${tool} ${version} using chocolatey`); - await exec('powershell', [ - 'choco', - 'install', - tool, - '--version', - version, - '-m', - '--no-progress', - '-r' - ]); + await exec( + 'powershell', + [ + 'choco', + 'install', + tool, + '--version', + version, + '-m', + '--no-progress', + '-r' + ], + { + ignoreReturnCode: true + } + ); } async function ghcupBin(os: OS): Promise { @@ -199,6 +205,12 @@ async function ghcupBin(os: OS): Promise { async function ghcup(tool: Tool, version: string, os: OS): Promise { core.info(`Attempting to install ${tool} ${version} using ghcup`); const bin = await ghcupBin(os); - await exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version]); - if (tool === 'ghc') await exec(bin, ['set', version]); + const returnCode = await exec( + bin, + [tool === 'ghc' ? 'install' : 'install-cabal', version], + { + ignoreReturnCode: true + } + ); + if (returnCode === 0 && tool === 'ghc') await exec(bin, ['set', version]); }