diff --git a/spec/convert-version-spec.ts b/spec/convert-version-spec.ts index 914c305..0824577 100644 --- a/spec/convert-version-spec.ts +++ b/spec/convert-version-spec.ts @@ -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'); }); diff --git a/src/index.ts b/src/index.ts index 6419626..4229a6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) {