Skip to content

Commit

Permalink
Handle only latestFeature option
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Safonkin committed Aug 30, 2021
1 parent 33fad1d commit b2cf6c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/setup-dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ 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
fs.readFileSync(globalJsonPath, {encoding: 'utf8'}).trim()
);
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}`;
}
Expand Down

0 comments on commit b2cf6c7

Please sign in to comment.