Skip to content

Commit

Permalink
Don't fail on old format lockfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Dec 10, 2023
1 parent 7776923 commit d7128c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/Spago/Config.purs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ readWorkspace maybeSelectedPackage pureBuild = do

maybeLockfileContents <- FS.exists "spago.lock" >>= case _ of
true -> liftAff (FS.readYamlFile Lock.lockfileCodec "spago.lock") >>= case _ of
Left error -> die $ "Your project contains a spago.lock file, but it cannot be decoded:\n" <> error
Left error -> do
logWarn
[ "Your project contains a spago.lock file, but it cannot be decoded. Spago will generate a new one."
, "Error was: " <> error
]
pure Nothing
-- Here we figure out if the lockfile is still up to date by having a quick look at the configurations:
-- if they changed since the last write, then we need to regenerate the lockfile
-- Unless! the user is passing the --pure flag, in which case we just use the lockfile
Expand Down

0 comments on commit d7128c7

Please sign in to comment.