mega-sdist 0.4.2.0 → 0.4.2.1
raw patch · 3 files changed
+19/−4 lines, 3 filesdep +aeson
Dependencies added: aeson
Files
- ChangeLog.md +4/−0
- mega-sdist.cabal +3/−2
- mega-sdist.hs +12/−2
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for mega-sdist +## 0.4.2.1++* Support `aeson` 2+ ## 0.4.2.0 * Support `pantry` 0.5.3
mega-sdist.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: mega-sdist-version: 0.4.2.0+version: 0.4.2.1 synopsis: Handles uploading to Hackage from mega repos description: Please see the description on Github at <https://github.com/snoyberg/mega-sdist#readme> category: Distribution@@ -30,7 +30,8 @@ Paths_mega_sdist ghc-options: -threaded -with-rtsopts=-N build-depends:- base ==4.*+ aeson+ , base ==4.* , bytestring , optparse-simple , pantry >=0.4
mega-sdist.hs view
@@ -22,6 +22,10 @@ import Path (parseAbsDir) import Path.IO (resolveFile') +#if MIN_VERSION_aeson(2, 0, 0)+import qualified Data.Aeson.KeyMap+#endif+ data App = App { appLogFunc :: !LogFunc , appProcessContext :: !ProcessContext@@ -40,11 +44,17 @@ getPaths :: MonadIO m => Value -> m [FilePath] getPaths value = maybe (error $ "getPaths failed: " ++ show value) return $ do Object top <- return value- Object locals <- HM.lookup "locals" top+ Object locals <- mylookup "locals" top forM (toList locals) $ \l -> do Object o <- return l- String path <- HM.lookup "path" o+ String path <- mylookup "path" o return $ T.unpack path+ where+#if MIN_VERSION_aeson(2, 0, 0)+ mylookup = Data.Aeson.KeyMap.lookup+#else+ mylookup = HM.lookup+#endif data Args = Args { toTag :: !Bool