Fix upgrade subcommand running appstate twice

This commit is contained in:
Julian Ospald 2021-07-27 20:57:51 +02:00
parent e4e52ebf6b
commit 0c666a6bbe
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
1 changed files with 19 additions and 16 deletions

View File

@ -2026,9 +2026,12 @@ Make sure to clean up #{tmpdir} afterwards.|])
(UpgradeAt p) -> pure $ Just p
UpgradeGHCupDir -> pure (Just (binDir </> "ghcup" <> exeExt))
runUpgrade (liftE $ upgradeGHCup target force') >>= \case
VRight v' -> do
GHCupInfo { _ghcupDownloads = dls } <- runAppState getGHCupInfo
runUpgrade (do
v' <- liftE $ upgradeGHCup target force'
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
pure (v', dls)
) >>= \case
VRight (v', dls) -> do
let pretty_v = prettyVer v'
let vi = fromJust $ snd <$> getLatest dls GHCup
runLogger $ $(logInfo)