-
Notifications
You must be signed in to change notification settings - Fork 543
Description
Description
I'd like to suggest an option to be able to pass includePrerelease: true (to disable the default behavior in semver) on the semver.satisfies calls (and any other semver call) done in installer.ts:
Lines 294 to 305 in 7df9f59
| releasesInfo = releasesInfo.filter((releaseInfo: any) => { | |
| return ( | |
| semver.satisfies( | |
| releaseInfo['sdk']['version'], | |
| versionInfo.version() | |
| ) || | |
| semver.satisfies( | |
| releaseInfo['sdk']['version-display'], | |
| versionInfo.version() | |
| ) | |
| ); | |
| }); |
Details
This would enable anyone to get the latest preview version of, for example, .NET 5.0 with the 5, 5.0, 5.*, 5.x, 5.0.* or 5.0.x patterns (tested locally with semver 7.3.2 and node.js v14.2.0):
> semver.satisfies("5.0.0-preview.6", "5.0.*")
false
> semver.satisfies("5.0.0-preview.6", "5.0.*", {includePrerelease: true})
true
The default behavior in semver makes it so that prerelease tags aren't matched by semver.satisfies unless you pass the same exact version (making wildcards useless for prerelease matching purposes).
The default behavior would be the current one (includePrerelease: false) to avoid breaking changes.
I would be willing to work on a PR however I created this issue to obtain feedback before I put in any work into it.