From 122c54b51e46a70949f3a37612d947850f80cf92 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 30 Jul 2020 20:04:37 +0200 Subject: [PATCH] Refactor --- lib/GHCup/Utils.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/GHCup/Utils.hs b/lib/GHCup/Utils.hs index f251ab9..53b9523 100644 --- a/lib/GHCup/Utils.hs +++ b/lib/GHCup/Utils.hs @@ -376,17 +376,16 @@ unpackToDir dest av = do #if defined(TAR) let untar :: MonadIO m => BL.ByteString -> Excepts '[] m () untar = liftIO . Tar.unpack (toFilePath dest) . Tar.read + + rf :: MonadIO m => Path Abs -> Excepts '[] m BL.ByteString + rf = liftIO . readFile #else let untar :: MonadIO m => BL.ByteString -> Excepts '[ArchiveResult] m () untar = lEM . liftIO . runArchiveM . unpackToDirLazy (T.unpack . decUTF8Safe . toFilePath $ dest) -#endif -#if defined(TAR) - rf :: MonadIO m => Path Abs -> Excepts '[] m BL.ByteString -#else rf :: MonadIO m => Path Abs -> Excepts '[ArchiveResult] m BL.ByteString -#endif rf = liftIO . readFile +#endif -- extract, depending on file extension if