swap out system.Directory.rename for Win32.File.moveFileEx for windows

This commit is contained in:
Arjun Kathuria 2021-06-25 16:09:26 +05:30
parent 9f5df9db10
commit a40d0cbb5c
1 changed files with 3 additions and 2 deletions

View File

@ -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