From cae98c4b9e127298f443c0be9ef94d290700e67d Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Mon, 4 Sep 2023 04:22:05 +0200 Subject: [PATCH] Update listSdks to not fail when dotnet util is not installed --- src/dotnet-utils.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dotnet-utils.ts b/src/dotnet-utils.ts index a4e45b628..6ba129701 100644 --- a/src/dotnet-utils.ts +++ b/src/dotnet-utils.ts @@ -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 [];