Make getKeychain parametric
This commit is contained in:
parent
948cf41665
commit
fc67f3938b
@ -39,12 +39,11 @@ keychainList :: IO [FilePath]
|
||||
keychainList = do
|
||||
raw <- readProcess "security" ["list-keychains"] ""
|
||||
case runParser parseKeychainList raw of
|
||||
Just list -> return list
|
||||
Just list -> return $ filter ((/="System") . takeBaseName) list
|
||||
Nothing -> error "failed to parse active keychains list"
|
||||
|
||||
getKeychain :: IO Keychain
|
||||
getKeychain = do
|
||||
paths <- filter ((/="System") . takeBaseName) <$> keychainList
|
||||
getKeychain :: [FilePath] -> IO Keychain
|
||||
getKeychain paths = do
|
||||
raw <- readProcess "security" ("dump-keychain" : "-d" : paths) ""
|
||||
case runParser parseKeychain raw of
|
||||
Just items -> return items
|
||||
|
Loading…
Reference in New Issue
Block a user