Skip to content

Commit

Permalink
Handles non-existent lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinaldi committed Aug 3, 2015
1 parent 1ae326a commit 501a4dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Paket.Core/UpdateProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ let selectiveUpdate resolve lockFile dependenciesFile updateAll package =
LockFile(lockFile.FileName, dependenciesFile.Options, resolution.ResolvedPackages.GetModelOrFail(), resolution.ResolvedSourceFiles)

let SelectiveUpdate(dependenciesFile : DependenciesFile, updateAll, exclude, force) =
let oldLockFile = LockFile.LoadFrom <| dependenciesFile.FindLockfile().FullName
let lockFileName = DependenciesFile.FindLockfile dependenciesFile.FileName
let oldLockFile =
if not lockFileName.Exists then
LockFile.Parse(lockFileName.FullName, [||])
else
LockFile.LoadFrom lockFileName.FullName

let lockFile = selectiveUpdate (fun d p -> d.Resolve(force, p)) oldLockFile dependenciesFile updateAll exclude
lockFile.Save()
lockFile
Expand Down

0 comments on commit 501a4dd

Please sign in to comment.