diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 12f2c12..c2be448 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -1341,6 +1341,9 @@ rmGhcupDirs = do -- remove entire logs Dir rmLogsDir logsDir + -- remove bin directory conditionally + rmBinDir binDir + liftIO $ print dirs where @@ -1365,6 +1368,16 @@ rmGhcupDirs = do forM_ contents deleteFile removeDirIfEmpty logsDir + rmBinDir binDir = do +#if !defined(IS_WINDOWS) + isXDGStyle <- useXDG + if not isXDGStyle + then removeDirIfEmpty binDir + else pure () +#else + removeDirIfEmpty binDir +#endif + deleteFile filepath = do hideError InappropriateType $ rmFile filepath