From 090150cebf1d8ae56265e84380f5f968b821ece5 Mon Sep 17 00:00:00 2001 From: Alex Kozack Date: Wed, 21 Dec 2016 18:23:14 +0200 Subject: [PATCH] fix: Trim suffix from wine version (#1033) Closes #1031 #953 --- src/packager.ts | 5 +++++ test/src/BuildTest.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/packager.ts b/src/packager.ts index 12be14050d9..73db795e82c 100644 --- a/src/packager.ts +++ b/src/packager.ts @@ -320,6 +320,11 @@ export async function checkWineVersion(checkPromise: Promise) { wineVersion = wineVersion.substring(0, spaceIndex) } + const suffixIndex = wineVersion.indexOf("-") + if (suffixIndex > 0) { + wineVersion = wineVersion.substring(0, suffixIndex) + } + if (wineVersion.split(".").length === 2) { wineVersion += ".0" } diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts index 77c0d98aed7..ef69abe0c11 100644 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -213,10 +213,11 @@ test.ifDevOrLinuxCi("smart unpack", () => { test("wine version", async () => { await checkWineVersion(BluebirdPromise.resolve("1.9.23 (Staging)")) + await checkWineVersion(BluebirdPromise.resolve("2.0-rc2")) }) function currentPlatform(): PackagerOptions { return { targets: Platform.fromString(process.platform).createTarget(DIR_TARGET), } -} \ No newline at end of file +}