-
Notifications
You must be signed in to change notification settings - Fork 525
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
#2419. Try parse SemVerInfo from .nupkg file name for localFolder nuget source #2422
Conversation
wow this looks very good! |
@@ -41,16 +52,18 @@ let findLocalPackage directory (packageName:PackageName) (version:SemVerInfo) = | |||
let v2 = FileInfo(Path.Combine(directory, sprintf "%O.%s.nupkg" packageName normalizedVersion)) | |||
if v2.Exists then v2 else | |||
|
|||
let condition x = | |||
match parsePackageInfoFromFileName x with | |||
| Some (name, ver) -> packageName.Equals name && version.Equals ver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not | Some (name, ver) -> packageName = name && version = ver
?
("package.name.with.dots.1.2.3-alpha2.nupkg", Some (PackageName "package.name.with.dots", SemVer.Parse "1.2.3-alpha2")); | ||
("package.1.2.3.nupkg.back", None); | ||
("package.name.without.version.nupkg", None); | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[
"package.1.2.3.nupkg", Some (PackageName "package", SemVer.Parse "1.2.3")
"package.1.2.3-alpha2.nupkg", Some (PackageName "package", SemVer.Parse "1.2.3-alpha2")
"package.name.with.dots.1.2.3-alpha2.nupkg", Some (PackageName "package.name.with.dots", SemVer.Parse "1.2.3-alpha2")
"package.1.2.3.nupkg.back", None
"package.name.without.version.nupkg", None
]
[<Test>] | ||
let ``package file picked up correctly``() = | ||
[ // folder * inputPackageId * inputPackageVersion * expectedFileName | ||
"./NuGetLocal/case1", PackageName "package.name", SemVer.Parse "0.1.0-alpha2", "package.name.0.1.0-alpha2.nupkg"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, fix all three places
travis failures seem unrelated. |
For the travis failure we will soon have #2423 |
fixes #2419