aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--astore.cabal1
-rw-r--r--src/Store/Query.hs3
2 files changed, 3 insertions, 1 deletions
diff --git a/astore.cabal b/astore.cabal
index 77b450b..a59eb0f 100644
--- a/astore.cabal
+++ b/astore.cabal
@@ -32,6 +32,7 @@ library
build-depends:
aeson,
+ aeson-pretty,
base,
bytestring,
containers,
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)))