updates usages of `installHLSBin` across files

This commit is contained in:
Arjun Kathuria 2021-07-25 22:10:10 +05:30
parent 7471f4f4dc
commit 90ed0895d6
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

@ -1705,26 +1705,20 @@ 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
Nothing -> runInstTool instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
liftE $ installHLSBin (_tvVersion v)
pure vi
Just uri -> do
s' <- appState
runInstTool' s'{ settings = settings { noVerify = True}} instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
liftE $ installHLSBindist
(DownloadInfo uri Nothing "")
(_tvVersion v)
pure vi
(case instBindist of
Nothing -> runInstTool instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
liftE $ installHLSBin (_tvVersion v) isolateDir
pure vi
Just uri -> do
s' <- appState
runInstTool' s'{ settings = settings { noVerify = True}} instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer HLS
liftE $ installHLSBindist
(DownloadInfo uri Nothing "")
(_tvVersion v)
isolateDir
pure vi
)
>>= \case
VRight vi -> do

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