Formatting

This commit is contained in:
Julian Ospald 2020-04-17 18:54:21 +02:00
parent 0623c7b1b1
commit dfeb814dcc
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -527,10 +527,8 @@ describe_result = $( (LitE . StringL) <$>
main :: IO ()
main = do
let
versionHelp = infoOption
(("The GHCup Haskell installer, version " <>
)
let versionHelp = infoOption
( ("The GHCup Haskell installer, version " <>)
$ (head . lines $ describe_result)
)
(long "version" <> help "Show version")
@ -721,7 +719,9 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
)
>>= \case
VRight v -> do
runLogger $ $(logInfo) [i|GHC #{prettyVer v} successfully set as default version|]
runLogger
$ $(logInfo)
[i|GHC #{prettyVer v} successfully set as default version|]
pure ExitSuccess
VLeft e -> do
runLogger ($(logError) [i|#{e}|])
@ -744,16 +744,14 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
liftE $ rmGHCVer ghcVer
)
>>= \case
VRight _ ->
pure ExitSuccess
VRight _ -> pure ExitSuccess
VLeft e -> do
runLogger ($(logError) [i|#{e}|])
pure $ ExitFailure 7
DInfo -> do
(runDebugInfo $ do
liftE $ getDebugInfo
)
DInfo ->
do
(runDebugInfo $ liftE $ getDebugInfo)
>>= \case
VRight dinfo -> do
putStrLn $ prettyDebugInfo dinfo
@ -763,9 +761,12 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
pure $ ExitFailure 8
Compile (CompileGHC CompileOptions {..}) ->
(runCompileGHC $ do
liftE
$ compileGHC dls targetVer bootstrapGhc jobs buildConfig patchDir
(runCompileGHC $ liftE $ compileGHC dls
targetVer
bootstrapGhc
jobs
buildConfig
patchDir
)
>>= \case
VRight _ -> do
@ -793,8 +794,10 @@ Make sure to clean up #{tmpdir} afterwards.|]
)
>>= \case
VRight _ -> do
runLogger ($(logInfo)
"Cabal successfully compiled and installed")
runLogger
($(logInfo)
"Cabal successfully compiled and installed"
)
pure ExitSuccess
VLeft (V (BuildFailed tmpdir e)) -> do
runLogger
@ -817,42 +820,46 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
bdir <- liftIO $ ghcupBinDir
pure (Just (bdir </> [rel|ghcup|]))
(runUpgrade $ (liftE $ upgradeGHCup dls target force))
>>= \case
(runUpgrade $ (liftE $ upgradeGHCup dls target force)) >>= \case
VRight v' -> do
let pretty_v = prettyVer v'
runLogger
$ $(logInfo)
runLogger $ $(logInfo)
[i|Successfully upgraded GHCup to version #{pretty_v}|]
pure ExitSuccess
VLeft (V NoUpdate) -> do
runLogger $ $(logWarn)
[i|No GHCup update available|]
runLogger $ $(logWarn) [i|No GHCup update available|]
pure ExitSuccess
VLeft e -> do
runLogger ($(logError) [i|#{e}|])
pure $ ExitFailure 11
ToolRequirements -> (runLogger $ runE
@'[ NoCompatiblePlatform
, DistroNotFound
, NoToolRequirements
] $ do
ToolRequirements ->
( runLogger
$ runE
@'[NoCompatiblePlatform , DistroNotFound , NoToolRequirements]
$ do
platform <- liftE $ getPlatform
req <- (getCommonRequirements platform $ treq)
req <-
(getCommonRequirements platform $ treq)
?? NoToolRequirements
liftIO $ T.hPutStr stdout (prettyRequirements req))
liftIO $ T.hPutStr stdout (prettyRequirements req)
)
>>= \case
VRight _ -> pure ExitSuccess
VLeft e -> do
runLogger
($(logError) [i|Error getting tool requirements: #{e}|])
($(logError)
[i|Error getting tool requirements: #{e}|]
)
pure $ ExitFailure 12
case res of
ExitSuccess -> pure ()
ef@(ExitFailure _) -> do
runLogger ($(logError) [i|If you think this is a bug, report at: https://gitlab.haskell.org/haskell/ghcup-hs/issues|])
runLogger
($(logError)
[i|If you think this is a bug, report at: https://gitlab.haskell.org/haskell/ghcup-hs/issues|]
)
exitWith ef
pure ()