From 41783ff02750aa7de1a4d63ba88364da6bdfc6c2 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 13 Jun 2021 15:08:31 +0200 Subject: [PATCH] Fix ghcup upgrade if binary is in non-standard location --- lib/GHCup.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 2c51c6d..372a422 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -1644,7 +1644,9 @@ upgradeGHCup mtarget force = do liftIO $ hideError NoSuchThing $ rmFile tempGhcup lift $ $(logDebug) [i|mv #{destFile} #{tempGhcup}|] - liftIO $ Win32.moveFileEx destFile (Just tempGhcup) 0 + -- NoSuchThing may be raised when we're updating ghcup from + -- a non-standard location + liftIO $ hideError NoSuchThing $ Win32.moveFileEx destFile (Just tempGhcup) 0 lift $ $(logDebug) [i|cp #{p} #{destFile}|] handleIO (throwE . CopyError . show) $ liftIO $ copyFile p destFile