Fix Error when ~/.ghcup is a valid symlink

Fixes #49
This commit is contained in:
2020-08-31 13:03:12 +02:00
parent ce3d1f4309
commit 326bf510c9
5 changed files with 33 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ Here we define our main logger.
module GHCup.Utils.Logger where
import GHCup.Types
import GHCup.Utils
import Control.Monad
import Control.Monad.IO.Class
@@ -69,7 +70,7 @@ initGHCupFileLogging context = do
Settings {dirs = Dirs {..}} <- ask
let logfile = logsDir </> context
liftIO $ do
createDirRecursive newDirPerms logsDir
createDirRecursive' logsDir
hideError doesNotExistErrorType $ deleteFile logfile
createRegularFile newFilePerms logfile
pure logfile