updates usages of installHLSBin across files

This commit is contained in:
Arjun Kathuria 2021-07-25 22:10:10 +05:30
parent e5d3080b54
commit 9c22ba9d45
3 changed files with 18 additions and 23 deletions

View File

@ -457,7 +457,7 @@ install' _ (_, ListResult {..}) = do
liftE $ upgradeGHCup Nothing False $> vi
HLS -> do
let vi = getVersionInfo lVer HLS dls
liftE $ installHLSBin lVer $> vi
liftE $ installHLSBin lVer Nothing $> vi
Stack -> do
let vi = getVersionInfo lVer Stack dls
liftE $ installStackBin lVer $> vi

View File

@ -1675,17 +1675,10 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
pure $ ExitFailure 4
let installHLS InstallOptions{..} =
(case isolateDir of
Just isoDir -> runInstTool instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
let hlsVersion = (_tvVersion v)
liftE $ installHLSBinIsolated isoDir hlsVersion
pure vi
Nothing ->
case instBindist of
(case instBindist of
Nothing -> runInstTool instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
liftE $ installHLSBin (_tvVersion v)
liftE $ installHLSBin (_tvVersion v) isolateDir
pure vi
Just uri -> do
s' <- appState
@ -1694,6 +1687,7 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
liftE $ installHLSBindist
(DownloadInfo uri Nothing "")
(_tvVersion v)
isolateDir
pure vi
)
>>= \case

View File

@ -689,6 +689,7 @@ installHLSBin :: ( MonadMask m
, MonadFail m
)
=> Version
-> Maybe FilePath
-> Excepts
'[ AlreadyInstalled
, CopyError
@ -704,9 +705,9 @@ installHLSBin :: ( MonadMask m
]
m
()
installHLSBin ver = do
installHLSBin ver isoFilepath = do
dlinfo <- liftE $ getDownloadInfo HLS ver
installHLSBindist dlinfo ver
installHLSBindist dlinfo ver isoFilepath
-- | Installs stack into @~\/.ghcup\/bin/stack-\<ver\>@ and