From a40d0cbb5c85cd580cdf5cf2ecc5edc9b5bfbe5e Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Fri, 25 Jun 2021 16:09:26 +0530 Subject: [PATCH] swap out system.Directory.rename for Win32.File.moveFileEx for windows --- lib/GHCup.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 3aa0138..d5d71e9 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -1298,9 +1298,10 @@ rmGhcup = do -- we move it to temp dir, to be deleted at next reboot tempDir <- liftIO $ getTemporaryDirectory tempFilepath = tempDir ghcupFilename - hideError doesNotExistErrorType $ liftIO $ renameFile ghcupFilepath tempFilepath + liftIO $ hideError NoSuchThing $ Win32.moveFileEx ghcupFilepath (Just tempFilepath) 1 #else - hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath + -- delete it. + hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath #endif rmTool :: ( MonadReader AppState m