adds bin dir removal code, checking for XDG
This commit is contained in:
parent
3fae516ce4
commit
82a8c61cf6
13
lib/GHCup.hs
13
lib/GHCup.hs
@ -1341,6 +1341,9 @@ rmGhcupDirs = do
|
|||||||
-- remove entire logs Dir
|
-- remove entire logs Dir
|
||||||
rmLogsDir logsDir
|
rmLogsDir logsDir
|
||||||
|
|
||||||
|
-- remove bin directory conditionally
|
||||||
|
rmBinDir binDir
|
||||||
|
|
||||||
liftIO $ print dirs
|
liftIO $ print dirs
|
||||||
|
|
||||||
where
|
where
|
||||||
@ -1365,6 +1368,16 @@ rmGhcupDirs = do
|
|||||||
forM_ contents deleteFile
|
forM_ contents deleteFile
|
||||||
removeDirIfEmpty logsDir
|
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
|
deleteFile filepath = do
|
||||||
hideError InappropriateType $ rmFile filepath
|
hideError InappropriateType $ rmFile filepath
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user