summaryrefslogtreecommitdiff
path: root/src/Propellor/DotDir.hs
diff options
context:
space:
mode:
authorJoey Hess2016-04-05 11:35:59 -0400
committerJoey Hess2016-04-05 11:35:59 -0400
commitd451d5f8f8be24d8e16459c85ebf53c152761610 (patch)
treecd59220cf88af3e1dfc42f50a0eb1956cc6e433a /src/Propellor/DotDir.hs
parent0ca752f9471a6dee173dec810c0749f4214e5304 (diff)
slightly more robust cabal file reading
Diffstat (limited to 'src/Propellor/DotDir.hs')
-rw-r--r--src/Propellor/DotDir.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs
index 100342e8..669ac303 100644
--- a/src/Propellor/DotDir.hs
+++ b/src/Propellor/DotDir.hs
@@ -78,9 +78,11 @@ cabalSandboxRequired :: IO Bool
cabalSandboxRequired = ifM cabal
( do
home <- myHomeDir
- ls <- lines <$> readFile (home </> ".cabal" </> "config")
+ ls <- lines <$> catchDefaultIO []
+ (readFile (home </> ".cabal" </> "config"))
-- For simplicity, we assume a sane ~/.cabal/config here:
- return $ "require-sandbox: True" `elem` ls
+ return $ any ("True" `isInfixOf`) $
+ filter ("require-sandbox:" `isPrefixOf`) ls
, return False
)
where