Handle only latestFeature option

This commit is contained in:
Vladimir Safonkin 2021-08-30 17:27:01 +03:00
parent 33fad1d142
commit b2cf6c7cd4

View File

@ -49,7 +49,6 @@ export async function run() {
} }
function getVersionFromGlobalJson(globalJsonPath: string): string { function getVersionFromGlobalJson(globalJsonPath: string): string {
const optionValues = ['latestFeature', 'latestPatch'];
let version: string = ''; let version: string = '';
const globalJson = JSON.parse( const globalJson = JSON.parse(
// .trim() is necessary to strip BOM https://github.com/nodejs/node/issues/20649 // .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) { if (globalJson.sdk && globalJson.sdk.version) {
version = globalJson.sdk.version; version = globalJson.sdk.version;
const rollForward = globalJson.sdk.rollForward ?? ''; const rollForward = globalJson.sdk.rollForward;
if (optionValues.includes(rollForward)) { if (rollForward && rollForward === 'latestFeature') {
const [major, minor] = version.split('.'); const [major, minor] = version.split('.');
version = `${major}.${minor}`; version = `${major}.${minor}`;
} }