Skip to content

Commit

Permalink
Better error message when lock file doesn't contain version pin - fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 27, 2015
1 parent d8f6301 commit d54c784
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.28.1 - 27.11.2015
* Better error message when lock file doesn't contain version pin - https://github.com/fsprojects/Paket/issues/1256

#### 2.28.1 - 27.11.2015
* Do not normalize versions since it might break Klondike - https://github.com/fsprojects/Paket/issues/1257

Expand Down
10 changes: 9 additions & 1 deletion integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ let ``#1233 install props``() =
let oldFile = Path.Combine(originalScenarioPath "i001233-props-files","MyClassLibrary","MyClassLibrary","MyClassLibrary.csprojtemplate")
let s1 = File.ReadAllText oldFile |> normalizeLineEndings
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s1 |> shouldEqual s2
s1 |> shouldEqual s2

[<Test>]
let ``#1256 should report error in lock file``() =
try
install "i001256-wrong-lock" |> ignore
failwith "error expected"
with
| exn when exn.Message.Contains("FAKE") && exn.Message.Contains("paket.lock") -> ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source https://nuget.org/api/v2

nuget FAKE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NUGET
remote: https://nuget.org/api/v2
specs:
FAKE
5 changes: 4 additions & 1 deletion src/Paket.Core/LockFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ module LockFileParser =
| Some remote ->
let package,settings = parsePackage details
let parts' = package.Split ' '
let version = parts'.[1] |> removeBrackets
let version =
if parts'.Length < 2 then
failwithf "No version specified for package %O in group %O." package currentGroup.GroupName
parts'.[1] |> removeBrackets

{ currentGroup with
LastWasPackage = true
Expand Down

0 comments on commit d54c784

Please sign in to comment.