summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-03-07 21:37:48 -0400
committerJoey Hess2016-03-07 21:37:48 -0400
commitc98285d957865aadaac3190543be1a1b3ae16476 (patch)
treed83efd3b5f7505a53b81c445a9fbe7154b0e3f67
parenta74348655a865182ff9776e1718b24263a5e73ab (diff)
avoid non-exhaustive pattern match
-rw-r--r--src/Propellor/Property/FreeBSD/Poudriere.hs4
1 files 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