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

The _versionRegex is not correct and fail to identify semver with dot separated prerelease identifiers #1829

Open
rickymohk opened this issue Sep 15, 2022 · 2 comments

Comments

@rickymohk
Copy link

Squirrel version(s)
Squirrel.Windows 2.0.1

Description
I am using electron-forge, which uses electron-winstaller which uses Squirrel.Windows 2.0.1, to try to build delta nupkg. My app version string follows the semver standard like 2.0.0-rc.2, with dot separated prerelease identifiers. It throws exception in SyncRelease. This is because the regex in

static readonly Regex _versionRegex = new Regex(@"\d+(\.\d+){0,3}(-[A-Za-z][0-9A-Za-z-]*)?$", RegexOptions.Compiled);

does not correctly capture the version string. It does not account for the "." character in the prerelease part, let alone the "+" character for the build metadata part.

Steps to recreate

  1. SyncRelease with a version string 2.0.0-rc.1 in the file name inside RELESAES file

Expected behavior
version string should be "2.0.0-rc.2"

Actual behavior
version string become "2"

Additional information
Why don't use the suggested regex from semver?
https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string

@caesay
Copy link

caesay commented Sep 15, 2022

This version of squirrel does not support semver2 syntax in several places. The StubExecutable, old Nuget library, and the code you found all expect semver1. It is a fairly big change to fix this in all places - and it's something that has been fixed in my fork.

@rickymohk
Copy link
Author

Thank you for explaining. I think I would explicitly rename my nupkg files then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants