From b2cf6c7cd41500af95efaa3b4d3ba79c0f77be84 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 30 Aug 2021 17:27:01 +0300 Subject: [PATCH] Handle only latestFeature option --- src/setup-dotnet.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index ae4fe7a..0d09998 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -49,7 +49,6 @@ export async function run() { } function getVersionFromGlobalJson(globalJsonPath: string): string { - const optionValues = ['latestFeature', 'latestPatch']; let version: string = ''; const globalJson = JSON.parse( // .trim() is necessary to strip BOM https://github.com/nodejs/node/issues/20649 @@ -57,8 +56,8 @@ function getVersionFromGlobalJson(globalJsonPath: string): string { ); if (globalJson.sdk && globalJson.sdk.version) { version = globalJson.sdk.version; - const rollForward = globalJson.sdk.rollForward ?? ''; - if (optionValues.includes(rollForward)) { + const rollForward = globalJson.sdk.rollForward; + if (rollForward && rollForward === 'latestFeature') { const [major, minor] = version.split('.'); version = `${major}.${minor}`; }