Adds basic implementation of rmTool function
This commit is contained in:
parent
0f6381e67b
commit
ec29332657
@ -1702,7 +1702,10 @@ Make sure to clean up #{tmpdir} afterwards.|])
|
|||||||
else putStrLn uri' >> pure ExitSuccess
|
else putStrLn uri' >> pure ExitSuccess
|
||||||
|
|
||||||
Nuke -> do
|
Nuke -> do
|
||||||
putStrLn "Nuking in 3...2....1"
|
putStrLn "Initiating Nuclear Sequence... "
|
||||||
|
lInstalled <- runLogger . flip runReaderT appstate $ listVersions Nothing (Just ListInstalled)
|
||||||
|
forM_ lInstalled $ runLogger . flip runReaderT appstate . rmTool
|
||||||
|
putStrLn "Nuking in 3...2...1"
|
||||||
putStrLn "BOOM!"
|
putStrLn "BOOM!"
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
|
|
||||||
|
34
lib/GHCup.hs
34
lib/GHCup.hs
@ -1282,6 +1282,40 @@ rmStackVer ver = do
|
|||||||
Nothing -> liftIO $ rmLink (binDir </> "stack" <> exeExt)
|
Nothing -> liftIO $ rmLink (binDir </> "stack" <> exeExt)
|
||||||
|
|
||||||
|
|
||||||
|
rmTool :: ( MonadReader AppState m
|
||||||
|
, MonadLogger m
|
||||||
|
, MonadFail m
|
||||||
|
, MonadMask m
|
||||||
|
, MonadUnliftIO m)
|
||||||
|
=> ListResult
|
||||||
|
-> m ()
|
||||||
|
|
||||||
|
rmTool tool = do
|
||||||
|
let ListResult {lVer, lTool, lCross} = tool
|
||||||
|
-- appstate <- ask
|
||||||
|
|
||||||
|
case lTool of
|
||||||
|
GHC -> do
|
||||||
|
let ghcTargetVersion = GHCTargetVersion lCross lVer
|
||||||
|
_ <- runE @'[NotInstalled] $ rmGHCVer ghcTargetVersion
|
||||||
|
pure ()
|
||||||
|
|
||||||
|
HLS -> do
|
||||||
|
_ <- runE @'[NotInstalled] $ rmHLSVer lVer
|
||||||
|
pure ()
|
||||||
|
|
||||||
|
Cabal -> do
|
||||||
|
_ <- runE @'[NotInstalled] $ rmCabalVer lVer
|
||||||
|
pure ()
|
||||||
|
|
||||||
|
Stack -> do
|
||||||
|
_ <- runE @'[NotInstalled] $ rmStackVer lVer
|
||||||
|
pure ()
|
||||||
|
|
||||||
|
GHCup -> do
|
||||||
|
-- leaving this unimplemented for now.
|
||||||
|
pure ()
|
||||||
|
|
||||||
|
|
||||||
------------------
|
------------------
|
||||||
--[ Debug info ]--
|
--[ Debug info ]--
|
||||||
|
Loading…
Reference in New Issue
Block a user