Fix bug with removing set GHC version

This commit is contained in:
Julian Ospald 2020-04-15 12:51:37 +02:00
parent 340196bf9d
commit b18aafe2c4
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 4 additions and 5 deletions

View File

@ -376,6 +376,10 @@ rmGHCVer ver = do
if exists
then do
-- this isn't atomic, order matters
when isSetGHC $ do
lift $ $(logInfo) [i|Removing ghc symlinks|]
liftE $ rmPlain ver
lift $ $(logInfo) [i|Removing directory recursively: #{d'}|]
liftIO $ deleteDirRecursive dir
@ -389,11 +393,6 @@ rmGHCVer ver = do
(mj, mi) <- getGHCMajor ver
getGHCForMajor mj mi >>= mapM_ (\v -> liftE $ setGHC v SetGHC_XY)
when isSetGHC $ do
lift $ $(logInfo) [i|Removing ghc symlinks|]
liftE $ rmPlain ver
liftIO
$ ghcupBaseDir
>>= hideError doesNotExistErrorType