couple of windows indentation fixes in source files

This commit is contained in:
Arjun Kathuria 2021-06-27 00:25:55 +05:30
parent aee7fa52c3
commit 8e4550657e
1 changed files with 14 additions and 13 deletions

View File

@ -1296,25 +1296,26 @@ rmGhcup = do
let ghcupFilepath = binDir </> ghcupFilename let ghcupFilepath = binDir </> ghcupFilename
currentRunningExecPath <- liftIO $ getExecutablePath currentRunningExecPath <- liftIO $ getExecutablePath
if currentRunningExecPath == ghcupFilepath if currentRunningExecPath == ghcupFilepath
then do then
do
#if defined(IS_WINDOWS) #if defined(IS_WINDOWS)
-- since it doesn't seem possible to delete a running exec in 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 -- we move it to temp dir, to be deleted at next reboot
tempDir <- liftIO $ getTemporaryDirectory tempDir <- liftIO $ getTemporaryDirectory
let tempFilepath = tempDir </> ghcupFilename let tempFilepath = tempDir </> ghcupFilename
hideError UnsupportedOperation $ hideError UnsupportedOperation $
liftIO $ hideError NoSuchThing $ liftIO $ hideError NoSuchThing $
Win32.moveFileEx ghcupFilepath (Just tempFilepath) 1 Win32.moveFileEx ghcupFilepath (Just tempFilepath) 1
#else #else
-- delete it. -- delete it.
hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath
#endif #endif
else else
$logWarn $ $logWarn $
nonStandardInstallLocationMsg currentRunningExecPath nonStandardInstallLocationMsg currentRunningExecPath
where where
nonStandardInstallLocationMsg path = T.pack $ nonStandardInstallLocationMsg path = T.pack $
"current ghcup is invoked from a non-standard location: \n" "current ghcup is invoked from a non-standard location: \n"
<> path <> <> path <>
"\n you may have to uninstall it manually." "\n you may have to uninstall it manually."