Skip to content

Commit

Permalink
Fix bump version (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNino authored Aug 1, 2024
1 parent 3b4346f commit d52e9a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions buildScripts/bump-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function assertVersion() {
let vssExtension = fs.readFileSync('vss-extension.json', 'utf8');
let vssExtensionJson = JSON.parse(vssExtension);
let oldExtensionVersionSplit = vssExtensionJson.version.split('.');
assert.ok(
(oldExtensionVersionSplit[1] < requestedVersionSplit[1] && requestedVersionSplit[2] === '0') || // Minor release
(oldExtensionVersionSplit[1] === requestedVersionSplit[1] && oldExtensionVersionSplit[2] < requestedVersionSplit[2]), // Patch release
'Input version must be bigger than current version',
);
assert.strictEqual(oldExtensionVersionSplit[0], requestedVersionSplit[0], 'Upgrading Major version using this script is forbidden');
const [oldMajor, oldMinor, oldPatch] = oldExtensionVersionSplit.map(Number);
const [newMajor, newMinor, newPatch] = requestedVersionSplit.map(Number);
let isMinorRelease = oldMinor < newMinor && newPatch === 0;
let isPatchRelease = oldMinor === newMinor && oldPatch < newPatch;
assert.ok(isMinorRelease || isPatchRelease, 'Input version must be bigger than current version');
assert.strictEqual(oldMajor, newMajor, 'Upgrading Major version using this script is forbidden');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/dotnet/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let inputs = {
arguments: '"--build-name=DotNET Test" "--build-number=7"',
rootPath: join(testUtils.getLocalTestDir(TEST_NAME)),
targetResolveRepo: testUtils.getRepoKeys().nugetVirtualRepo,
nugetProtocolVersion: "v3"
nugetProtocolVersion: 'v3',
};

testUtils.copyTestFilesToTestWorkDir(TEST_NAME, 'restore');
Expand Down

0 comments on commit d52e9a4

Please sign in to comment.