Skip to content

Commit 090150c

Browse files
cawa-93develar
authored andcommitted
fix: Trim suffix from wine version (#1033)
Closes #1031 #953
1 parent 0ce1a3c commit 090150c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/packager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ export async function checkWineVersion(checkPromise: Promise<string>) {
320320
wineVersion = wineVersion.substring(0, spaceIndex)
321321
}
322322

323+
const suffixIndex = wineVersion.indexOf("-")
324+
if (suffixIndex > 0) {
325+
wineVersion = wineVersion.substring(0, suffixIndex)
326+
}
327+
323328
if (wineVersion.split(".").length === 2) {
324329
wineVersion += ".0"
325330
}

test/src/BuildTest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ test.ifDevOrLinuxCi("smart unpack", () => {
213213

214214
test("wine version", async () => {
215215
await checkWineVersion(BluebirdPromise.resolve("1.9.23 (Staging)"))
216+
await checkWineVersion(BluebirdPromise.resolve("2.0-rc2"))
216217
})
217218

218219
function currentPlatform(): PackagerOptions {
219220
return {
220221
targets: Platform.fromString(process.platform).createTarget(DIR_TARGET),
221222
}
222-
}
223+
}

0 commit comments

Comments
 (0)