PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Bugfix - Correctly match package names from local repos

Open anamnavi opened this issue 1 year ago • 0 comments

PR Summary

There was a bug in how we parse out name and version information from package file names when performing search against local repositories.

If you have a package test and test.submodule` present in the local repository their files will look like this:

`test.1.0.0.nupkg`
`test.submodule.1.0.0.nupkg`

We used WildCardPattern class before, with pattern {packageName}.*" which would pick up both packages if package testwas searched for. The code logic then assumed the rest of the part of the name would be the version so it would search through both package names and try to parsesubmodule.1.0.0` into a version.

This fix uses Regex more accurately created for the package name and to expect a version right after the name, not text.

PR Context

Fixes #1641 #1648

PR Checklist

anamnavi avatar Jun 11 '24 16:06 anamnavi