List stray tools
This commit is contained in:
@@ -85,7 +85,7 @@ validate dls = do
|
||||
[i|FreeBSD missing for #{t} #{v'} #{arch}|]
|
||||
|
||||
checkUniqueTags tool = do
|
||||
let allTags = join $ fmap snd $ availableToolVersions dls tool
|
||||
let allTags = join $ M.elems $ availableToolVersions dls tool
|
||||
let nonUnique =
|
||||
fmap fst
|
||||
. filter (\(_, b) -> not b)
|
||||
@@ -118,7 +118,7 @@ validate dls = do
|
||||
|
||||
-- a tool must have at least one of each mandatory tags
|
||||
checkMandatoryTags tool = do
|
||||
let allTags = join $ fmap snd $ availableToolVersions dls tool
|
||||
let allTags = join $ M.elems $ availableToolVersions dls tool
|
||||
forM_ [Latest, Recommended] $ \t -> case elem t allTags of
|
||||
False -> do
|
||||
lift $ $(logError) [i|Tag #{t} missing from #{tool}|]
|
||||
|
||||
@@ -684,10 +684,7 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
||||
, TagNotFound
|
||||
]
|
||||
|
||||
let runListGHC =
|
||||
runLogger
|
||||
. flip runReaderT settings
|
||||
. runE @'[FileDoesNotExistError]
|
||||
let runListGHC = runE @'[] . runLogger
|
||||
|
||||
let runRmGHC =
|
||||
runLogger . flip runReaderT settings . runE @'[NotInstalled]
|
||||
@@ -825,7 +822,8 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
|
||||
|
||||
List (ListOptions {..}) ->
|
||||
(runListGHC $ do
|
||||
liftIO $ listVersions dls lTool lCriteria
|
||||
l <- listVersions dls lTool lCriteria
|
||||
pure l
|
||||
)
|
||||
>>= \case
|
||||
VRight r -> do
|
||||
@@ -1024,14 +1022,16 @@ printListResult lr = do
|
||||
, fmap toLower . show $ lTool
|
||||
, T.unpack . prettyVer $ lVer
|
||||
, intercalate "," $ ((fmap . fmap) toLower . fmap show $ lTag)
|
||||
, if fromSrc then (color Blue "compiled") else mempty
|
||||
, intercalate "," $
|
||||
(if fromSrc then [color Blue "compiled"] else mempty)
|
||||
++ (if lStray then [color Blue "stray"] else mempty)
|
||||
]
|
||||
)
|
||||
lr
|
||||
putStrLn $ formatted
|
||||
|
||||
|
||||
checkForUpdates :: (MonadIO m, MonadFail m, MonadLogger m)
|
||||
checkForUpdates :: (MonadThrow m, MonadIO m, MonadFail m, MonadLogger m)
|
||||
=> GHCupDownloads
|
||||
-> m ()
|
||||
checkForUpdates dls = do
|
||||
@@ -1057,7 +1057,7 @@ checkForUpdates dls = do
|
||||
|
||||
where
|
||||
latestInstalled tool = (fmap lVer . lastMay)
|
||||
<$> liftIO (listVersions dls (Just tool) (Just ListInstalled))
|
||||
<$> (listVersions dls (Just tool) (Just ListInstalled))
|
||||
|
||||
|
||||
prettyDebugInfo :: DebugInfo -> String
|
||||
|
||||
Reference in New Issue
Block a user