;tools: Shake changelogs: fix missing blank lines around old heading

This commit is contained in:
Simon Michael 2025-06-03 07:34:52 -10:00
parent aa0f4a74c9
commit 455db07495

View File

@ -747,14 +747,16 @@ main = do
:: Action (Stdout String)) :: Action (Stdout String))
-- Add the new heading and change items to the changelog, or print them. -- Add the new heading and change items to the changelog, or print them.
let newcontent = "# " ++ latestrev ++ "\n" ++ newitems let newcontent = "# " ++ latestrev ++ "\n\n" ++ newitems ++ "\n"
liftIO $ if dryrun liftIO $ if dryrun
then putStr $ out ++ ":\n" ++ newcontent then putStr $ out ++ ":\n" ++ newcontent
else do else do
writeFile out $ concat [ writeFile out $ concat [
unlines preamble unlines preamble
,newcontent ,newcontent
,"\n"
,if isCommitHash oldversion then "" else oldheading ,if isCommitHash oldversion then "" else oldheading
,"\n"
,unlines rest ,unlines rest
] ]
putStrLn (out ++ ": updated to " ++ latestrev) putStrLn (out ++ ": updated to " ++ latestrev)