Fix 'ghcup run' for legacy HLS
This commit is contained in:
parent
5186d959bc
commit
66a62c170c
@ -15,6 +15,7 @@ import GHCup.Utils.File
|
|||||||
import GHCup.OptParse.Common
|
import GHCup.OptParse.Common
|
||||||
import GHCup.Errors
|
import GHCup.Errors
|
||||||
import GHCup.Types
|
import GHCup.Types
|
||||||
|
import GHCup.Types.Optics ( getDirs )
|
||||||
import GHCup.Utils.Logger
|
import GHCup.Utils.Logger
|
||||||
import GHCup.Utils.String.QQ
|
import GHCup.Utils.String.QQ
|
||||||
|
|
||||||
@ -309,6 +310,20 @@ run RunOptions{..} runAppState leanAppstate runLogger = do
|
|||||||
cbin <- liftIO $ canonicalizePath bin
|
cbin <- liftIO $ canonicalizePath bin
|
||||||
lift $ createLink (relativeSymlink tmp cbin) (tmp </> "stack")
|
lift $ createLink (relativeSymlink tmp cbin) (tmp </> "stack")
|
||||||
HLS -> do
|
HLS -> do
|
||||||
|
Dirs {..} <- getDirs
|
||||||
|
let v' = _tvVersion v
|
||||||
|
legacy <- isLegacyHLS v'
|
||||||
|
if legacy
|
||||||
|
then do
|
||||||
|
-- TODO: factor this out
|
||||||
|
(Just hlsWrapper) <- hlsWrapperBinary v'
|
||||||
|
cw <- liftIO $ canonicalizePath (binDir </> hlsWrapper)
|
||||||
|
lift $ createLink (relativeSymlink tmp cw) (tmp </> takeFileName cw)
|
||||||
|
hlsBins <- hlsServerBinaries v' Nothing >>= liftIO . traverse (canonicalizePath . (binDir </>))
|
||||||
|
forM_ hlsBins $ \bin ->
|
||||||
|
lift $ createLink (relativeSymlink tmp bin) (tmp </> takeFileName bin)
|
||||||
|
liftE $ setHLS (_tvVersion v) SetHLSOnly (Just tmp)
|
||||||
|
else do
|
||||||
liftE $ setHLS (_tvVersion v) SetHLS_XYZ (Just tmp)
|
liftE $ setHLS (_tvVersion v) SetHLS_XYZ (Just tmp)
|
||||||
liftE $ setHLS (_tvVersion v) SetHLSOnly (Just tmp)
|
liftE $ setHLS (_tvVersion v) SetHLSOnly (Just tmp)
|
||||||
GHCup -> pure ()
|
GHCup -> pure ()
|
||||||
|
Loading…
Reference in New Issue
Block a user