Skip to content

Commit

Permalink
fix: Trim suffix from wine version (#1033)
Browse files Browse the repository at this point in the history
Closes  #1031 #953
  • Loading branch information
cawa-93 authored and develar committed Dec 21, 2016
1 parent 0ce1a3c commit 090150c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ export async function checkWineVersion(checkPromise: Promise<string>) {
wineVersion = wineVersion.substring(0, spaceIndex)
}

const suffixIndex = wineVersion.indexOf("-")
if (suffixIndex > 0) {
wineVersion = wineVersion.substring(0, suffixIndex)
}

if (wineVersion.split(".").length === 2) {
wineVersion += ".0"
}
Expand Down
3 changes: 2 additions & 1 deletion test/src/BuildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
}

0 comments on commit 090150c

Please sign in to comment.