From c98285d957865aadaac3190543be1a1b3ae16476 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Mar 2016 21:37:48 -0400 Subject: avoid non-exhaustive pattern match --- src/Propellor/Property/FreeBSD/Poudriere.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/FreeBSD/Poudriere.hs b/src/Propellor/Property/FreeBSD/Poudriere.hs index 8d809d8b..7ed7f59e 100644 --- a/src/Propellor/Property/FreeBSD/Poudriere.hs +++ b/src/Propellor/Property/FreeBSD/Poudriere.hs @@ -52,8 +52,8 @@ runPoudriere cmd args = lines <$> readProcess p a listJails :: IO [String] -listJails = - map ((\(n:_) -> n ) . take 1 . words) <$> runPoudriere "jail" ["-l", "-q"] +listJails = mapMaybe (headMaybe . take 1 . words) + <$> runPoudriere "jail" ["-l", "-q"] jailExists :: Jail -> IO Bool jailExists (Jail name _ _) = isInfixOf [name] <$> listJails -- cgit v1.2.3