Fix unstaged changes in index.js

This commit is contained in:
Vladimir Safonkin 2021-08-20 16:45:26 +03:00
parent 9480036ff9
commit 0067f023d2
1 changed files with 3 additions and 2 deletions

5
dist/index.js vendored
View File

@ -7853,14 +7853,15 @@ function run() {
} }
exports.run = run; exports.run = run;
function getVersionFromGlobalJson(globalJsonPath) { function getVersionFromGlobalJson(globalJsonPath) {
let version = ""; let version = '';
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
fs.readFileSync(globalJsonPath, { encoding: 'utf8' }).trim()); fs.readFileSync(globalJsonPath, { encoding: 'utf8' }).trim());
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 (rollForward && (rollForward === 'latestFeature' || rollForward === 'latestPatch')) { if (rollForward &&
(rollForward === 'latestFeature' || rollForward === 'latestPatch')) {
const [major, minor] = version.split('.'); const [major, minor] = version.split('.');
version = `${major}.${minor}`; version = `${major}.${minor}`;
} }