mirror of
https://github.com/nmattia/niv.git
synced 2024-11-07 22:36:53 +03:00
Prettify specs.json
This commit is contained in:
parent
9887f05524
commit
8f03de5944
3
Main.hs
3
Main.hs
@ -24,6 +24,7 @@ import System.Exit (exitFailure)
|
||||
import System.FilePath ((</>), takeDirectory)
|
||||
import System.Process (readProcess)
|
||||
import qualified Data.Aeson as Aeson
|
||||
import qualified Data.Aeson.Encode.Pretty as AesonPretty
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
import qualified Data.HashMap.Strict as HMap
|
||||
@ -477,7 +478,7 @@ 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 . Aeson.encode
|
||||
encodeFile fp = L.writeFile fp . AesonPretty.encodePretty
|
||||
|
||||
--- HashMap
|
||||
|
||||
|
@ -9,6 +9,7 @@ executable:
|
||||
main: Main.hs
|
||||
dependencies:
|
||||
- aeson
|
||||
- aeson-pretty
|
||||
- directory
|
||||
- string-qq
|
||||
- filepath
|
||||
|
Loading…
Reference in New Issue
Block a user