Update listSdks to not fail when dotnet util is not installed

This commit is contained in:
Nikolai Laevskii 2023-09-04 04:22:05 +02:00
parent 07be99e939
commit cae98c4b9e

View File

@ -1,13 +1,11 @@
import * as exec from '@actions/exec';
export const listSdks = async () => {
const {stdout, exitCode} = await exec.getExecOutput(
'dotnet',
['--list-sdks'],
{
const {stdout, exitCode} = await exec
.getExecOutput('dotnet', ['--list-sdks'], {
ignoreReturnCode: true
}
);
})
.catch(() => ({stdout: '', exitCode: 1}));
if (exitCode) {
return [];