ENH make getItems not depend on the reader config

This commit is contained in:
Nathan Dwarshuis 2020-12-11 17:37:38 -05:00
parent dbf48ad771
commit 930685f095
1 changed files with 3 additions and 2 deletions

View File

@ -171,9 +171,10 @@ runClient a = do
browseLogins :: RofiConf c => RofiIO c ()
browseLogins = do
session <- io callGetSession
forM_ session $ getItems >=> selectItem
forM_ session $ (io . getItems) >=> selectItem
getItems :: RofiConf c => String -> RofiIO c [Item]
-- TODO use this in rofi-dev to mount thing using BW passwords
getItems :: String -> IO [Item]
getItems session = do
items <- io $ readProcess "bw" ["list", "items", "--session", session] ""
return $ filter notEmpty $ fromMaybe [] $ decode $ fromString items