From 56fccc922fd3d7fdf748b7d2b6cf1df4e48bceb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Fri, 11 Oct 2024 17:12:39 +0200 Subject: pretty print JSON --- src/Store/Query.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Store') diff --git a/src/Store/Query.hs b/src/Store/Query.hs index c400206..091aae7 100644 --- a/src/Store/Query.hs +++ b/src/Store/Query.hs @@ -8,6 +8,7 @@ import Control.Arrow (second) import Control.Exception (throw) import Control.Monad.Trans (lift) import Data.Aeson qualified as J +import Data.Aeson.Encode.Pretty qualified as JP import Data.Aeson.Key qualified as JK import Data.Aeson.KeyMap qualified as JM import Data.List (foldl', foldl1') @@ -175,4 +176,4 @@ decodeFile c fn = do encodeFile :: String -> String -> J.Value -> S.StoreM () encodeFile c fn (J.Object kvs) = do let fp = c fn - S.writeFile fp (J.encode (J.Object (JM.filterWithKey (\k _ -> k /= "$fileName") kvs))) + S.writeFile fp (JP.encodePretty (J.Object (JM.filterWithKey (\k _ -> k /= "$fileName") kvs))) -- cgit v1.2.3