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