Skip to content

Commit

Permalink
Add header to lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed Oct 2, 2023
1 parent 3a44358 commit ca408e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Juvix/Compiler/Pipeline/Lockfile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ lockfileEncodeConfig = setConfCompare keyCompare defConfig
writeLockfile :: (Members '[Files] r) => Path Abs Dir -> Lockfile -> Sem r ()
writeLockfile root lf = do
ensureDir' (parent lockfilePath)
writeFileBS lockfilePath (encodePretty lockfileEncodeConfig lf)
writeFileBS lockfilePath (header <> encodePretty lockfileEncodeConfig lf)
where
lockfilePath :: Path Abs File
lockfilePath = mkPackageLockfilePath root

header :: ByteString
header = "# This file was autogenerated by Juvix.\n# Do not edit this file manually.\n\n"

-- | Extract a lockfileInfo associated with an immediate dependency. Returns Nothing
-- if the dependency is not specified at the root of the lockfile.
extractLockfileInfo :: LockfileInfo -> Dependency -> Maybe LockfileInfo
Expand Down

0 comments on commit ca408e5

Please sign in to comment.