ENH use bracket dbus for xmobar tests

This commit is contained in:
Nathan Dwarshuis 2022-12-31 22:33:33 -05:00
parent 3b8c6b0f4f
commit 8c20a4668d
1 changed files with 8 additions and 6 deletions

View File

@ -46,7 +46,7 @@ main = getArgs >>= parse
parse :: [String] -> IO ()
parse [] = run
parse ["--deps"] = withCache printDeps
parse ["--test"] = void $ withCache . evalConfig =<< connectDBus
parse ["--test"] = withCache $ withDBus_ evalConfig
parse _ = usage
run :: IO ()
@ -66,11 +66,13 @@ evalConfig db = do
return $ config bf ifs ios cs d
printDeps :: FIO ()
printDeps = do
db <- io connectDBus
let ps = sort $ nub $ fmap showFulfillment $ concatMap dumpFeature $ allFeatures db
io $ mapM_ (putStrLn . T.unpack) ps
io $ disconnectDBus db
printDeps = withDBus_ $ \db ->
mapM_ (liftIO . putStrLn . T.unpack) $
sort $
nub $
fmap showFulfillment $
concatMap dumpFeature $
allFeatures db
usage :: IO ()
usage =