Skip to content

Commit

Permalink
Merge pull request fsprojects#1558 from fsprojects/stablelock
Browse files Browse the repository at this point in the history
Check if lock keeps stable
  • Loading branch information
forki committed Mar 29, 2016
2 parents 241a1e7 + 9a9d3ba commit d3803b0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Paket.Core/SemVer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,9 @@ type SemVerInfo =
sprintf "%d.%d.%d%s%s" x.Major x.Minor x.Patch build pre

member x.NormalizeToShorter() =
let build =
if String.IsNullOrEmpty x.Build |> not && x.Build <> "0" then "." + x.Build
else ""

let pre =
match x.PreRelease with
| Some preRelease -> sprintf "-%s" preRelease.Origin
| None -> ""

let s = sprintf "%d.%d.%d%s%s" x.Major x.Minor x.Patch build pre
if s = sprintf "%d.%d.0" x.Major x.Minor then sprintf "%d.%d" x.Major x.Minor else s
let s = x.Normalize()
let s2 = sprintf "%d.%d" x.Major x.Minor
if s = s2 + ".0" then s2 else s

override x.ToString() =
match x.Original with
Expand Down

0 comments on commit d3803b0

Please sign in to comment.