From 8e4550657ec70c08bc92887ad243a21adcc896fa Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Sun, 27 Jun 2021 00:25:55 +0530 Subject: [PATCH] couple of windows indentation fixes in source files --- lib/GHCup.hs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 548f016..dcad07e 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -1296,25 +1296,26 @@ rmGhcup = do let ghcupFilepath = binDir ghcupFilename currentRunningExecPath <- liftIO $ getExecutablePath if currentRunningExecPath == ghcupFilepath - then do + then + do #if defined(IS_WINDOWS) - -- since it doesn't seem possible to delete a running exec in windows - -- we move it to temp dir, to be deleted at next reboot - tempDir <- liftIO $ getTemporaryDirectory - let tempFilepath = tempDir ghcupFilename - hideError UnsupportedOperation $ - liftIO $ hideError NoSuchThing $ - Win32.moveFileEx ghcupFilepath (Just tempFilepath) 1 + -- since it doesn't seem possible to delete a running exec in windows + -- we move it to temp dir, to be deleted at next reboot + tempDir <- liftIO $ getTemporaryDirectory + let tempFilepath = tempDir ghcupFilename + hideError UnsupportedOperation $ + liftIO $ hideError NoSuchThing $ + Win32.moveFileEx ghcupFilepath (Just tempFilepath) 1 #else - -- delete it. - hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath + -- delete it. + hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath #endif - else + else $logWarn $ nonStandardInstallLocationMsg currentRunningExecPath - where - nonStandardInstallLocationMsg path = T.pack $ + where + nonStandardInstallLocationMsg path = T.pack $ "current ghcup is invoked from a non-standard location: \n" <> path <> "\n you may have to uninstall it manually."