diff --git a/app/ghcup/BrickMain.hs b/app/ghcup/BrickMain.hs index ba6d8bc..497c2ba 100644 --- a/app/ghcup/BrickMain.hs +++ b/app/ghcup/BrickMain.hs @@ -448,7 +448,7 @@ install' _ (_, ListResult {..}) = do case lTool of GHC -> do let vi = getVersionInfo lVer GHC dls - liftE $ installGHCBin lVer $> vi + liftE $ installGHCBin lVer Nothing $> vi Cabal -> do let vi = getVersionInfo lVer Cabal dls liftE $ installCabalBin lVer $> vi diff --git a/app/ghcup/Main.hs b/app/ghcup/Main.hs index 0e0f26f..d5bb1c4 100644 --- a/app/ghcup/Main.hs +++ b/app/ghcup/Main.hs @@ -1601,28 +1601,22 @@ Report bugs at |] ----------------------- let installGHC InstallOptions{..} = - (case isolateDir of - Just isoDir -> runInstTool instPlatform $ do - (v, vi) <- liftE $ fromVersion instVer GHC - let ghcVersion = _tvVersion v - liftE $ installGHCBinIsolated isoDir ghcVersion - pure vi - Nothing -> - case instBindist of - Nothing -> runInstTool instPlatform $ do - (v, vi) <- liftE $ fromVersion instVer GHC - liftE $ installGHCBin (_tvVersion v) - when instSet $ void $ liftE $ setGHC v SetGHCOnly - pure vi - Just uri -> do - s' <- liftIO appState - runInstTool' s'{ settings = settings {noVerify = True}} instPlatform $ do - (v, vi) <- liftE $ fromVersion instVer GHC - liftE $ installGHCBindist - (DownloadInfo uri (Just $ RegexDir "ghc-.*") "") - (_tvVersion v) - when instSet $ void $ liftE $ setGHC v SetGHCOnly - pure vi + (case instBindist of + Nothing -> runInstTool instPlatform $ do + (v, vi) <- liftE $ fromVersion instVer GHC + liftE $ installGHCBin (_tvVersion v) isolateDir + when instSet $ void $ liftE $ setGHC v SetGHCOnly + pure vi + Just uri -> do + s' <- liftIO appState + runInstTool' s'{ settings = settings {noVerify = True}} instPlatform $ do + (v, vi) <- liftE $ fromVersion instVer GHC + liftE $ installGHCBindist + (DownloadInfo uri (Just $ RegexDir "ghc-.*") "") + (_tvVersion v) + isolateDir + when instSet $ void $ liftE $ setGHC v SetGHCOnly + pure vi ) >>= \case VRight vi -> do diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 0de2f92..5f86cad 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -405,6 +405,7 @@ installGHCBin :: ( MonadFail m , MonadUnliftIO m ) => Version -- ^ the version to install + -> Maybe FilePath -- ^ isolated install filepath, if user passed any -> Excepts '[ AlreadyInstalled , BuildFailed @@ -420,9 +421,9 @@ installGHCBin :: ( MonadFail m ] m () -installGHCBin ver = do +installGHCBin ver isoFilepath = do dlinfo <- liftE $ getDownloadInfo GHC ver - installGHCBindist dlinfo ver + installGHCBindist dlinfo ver isoFilepath -- | Like 'installCabalBin', except takes the 'DownloadInfo' as