From b1f3365c5a163ee1ef8b83a7da8b9737846ab57a Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Fri, 26 Apr 2019 00:16:17 +0200 Subject: [PATCH] Add a trailing new line to the sources.json file Just because VCS and editors can emit warnings on files without a trailing new line. --- app/Niv.hs | 4 +++- site/niv.svg | 6 +++--- tests/expected/niv-init.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Niv.hs b/app/Niv.hs index 42955b7..7b155c0 100644 --- a/app/Niv.hs +++ b/app/Niv.hs @@ -545,7 +545,9 @@ decodeFileStrict = fmap Aeson.decodeStrict . B.readFile -- | Efficiently serialize a JSON value as a lazy 'L.ByteString' and write it to a file. encodeFile :: (ToJSON a) => FilePath -> a -> IO () -encodeFile fp = L.writeFile fp . AesonPretty.encodePretty +encodeFile fp = L.writeFile fp . AesonPretty.encodePretty' config + where + config = AesonPretty.defConfig { AesonPretty.confTrailingNewline = True } --- HashMap diff --git a/site/niv.svg b/site/niv.svg index 7f5b3be..0816c11 100644 --- a/site/niv.svg +++ b/site/niv.svg @@ -1,10 +1,10 @@ - +