Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim suffix from wine version #1033

Merged
merged 3 commits into from
Dec 21, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added check "RC" version
cawa-93 authored Dec 21, 2016
commit b9617cb23ecc629ceeecbe4d5bc896bbee1b15de
5 changes: 5 additions & 0 deletions src/packager.ts
Original file line number Diff line number Diff line change
@@ -320,6 +320,11 @@ export async function checkWineVersion(checkPromise: Promise<string>) {
wineVersion = wineVersion.substring(0, spaceIndex)
}

const rcIndex = wineVersion.indexOf("-rc")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we can just check - to be prepared for another suffixes.

Copy link
Contributor Author

@cawa-93 cawa-93 Dec 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it may be simply makes sense to replace all - on .? In this case, you will see the difference between wine-2.0-rc1 and wine-2.0-rc2. They will be given to the form and 2.0.rc1 2.0.rc2. Semver be able to recognize this type of version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be simply makes sense to replace all "-" on "."?

It is not safe because we don't know format of rc — it can be not valid semver. So, it is better just to trim it.

you will see the difference between wine-2.0-rc1 and wine-2.0-rc2

Not required for now.

if (rcIndex > 0) {
wineVersion = wineVersion.substring(0, rcIndex)
}

if (wineVersion.split(".").length === 2) {
wineVersion += ".0"
}