Skip to content

Commit

Permalink
fix: Drop build metadata part in convertVersion (#472)
Browse files Browse the repository at this point in the history
* Drop build metadata part in convertVersion

* added test cases for convertVersion
  • Loading branch information
rickymohk authored May 19, 2023
1 parent 2def401 commit 275176c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions spec/convert-version-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ test('makes semver versions into valid NuGet versions', (t): void => {
t.is(convertVersion('1.2.3-alpha.1'), '1.2.3-alpha1');
t.is(convertVersion('1.2.3-alpha.1.2'), '1.2.3-alpha12');
t.is(convertVersion('1.2.3-alpha-1-2'), '1.2.3-alpha-1-2');
t.is(convertVersion('1.2.3-alpha.1.2+build-meta.1.2'), '1.2.3-alpha12');
t.is(convertVersion('1.2.3-alpha-1-2+build-meta.1.2'), '1.2.3-alpha-1-2');
});
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export { SquirrelWindowsOptions as Options} from './options';
const log = require('debug')('electron-windows-installer:main');

export function convertVersion(version: string): string {
const parts = version.split('-');
const parts = version.split('+')[0].split('-');
const mainVersion = parts.shift();

if (parts.length > 0) {
Expand Down

0 comments on commit 275176c

Please sign in to comment.