From ca408e534c403e7dd642e9fa036f1276e6ccc29d Mon Sep 17 00:00:00 2001 From: Paul Cadman Date: Mon, 2 Oct 2023 13:06:07 +0100 Subject: [PATCH] Add header to lockfile --- src/Juvix/Compiler/Pipeline/Lockfile.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Juvix/Compiler/Pipeline/Lockfile.hs b/src/Juvix/Compiler/Pipeline/Lockfile.hs index df9876e3ee..02657bec30 100644 --- a/src/Juvix/Compiler/Pipeline/Lockfile.hs +++ b/src/Juvix/Compiler/Pipeline/Lockfile.hs @@ -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