Skip to content

Commit

Permalink
Merge pull request #1482 from MaxDeg/master
Browse files Browse the repository at this point in the history
fix bug in getLastNuGetVersion when result is in JSON.
  • Loading branch information
forki authored Mar 12, 2017
2 parents cd6ca9a + 947ea4e commit 2a44e77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/FakeLib/NuGet/NugetVersion.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ open System.Xml
open System.Xml.Linq

type NuGetSearchItemResult =
{ Version:string
{ Id:string
Version:string
Published:DateTime }
type NuGetSearchResult =
{ results:NuGetSearchItemResult list }
Expand Down Expand Up @@ -59,6 +60,7 @@ let getLastNuGetVersion server (packageName:string) =
then
let json = JsonConvert.DeserializeObject<NuGetSearchResponse>(text)
json.d.results
|> Seq.filter (fun i -> i.Id = packageName)
|> Seq.sortByDescending (fun i -> i.Published)
|> Seq.tryHead
|> fun i ->
Expand Down

0 comments on commit 2a44e77

Please sign in to comment.