diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-04-05 11:35:59 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-04-05 11:35:59 -0400 |
| commit | d451d5f8f8be24d8e16459c85ebf53c152761610 (patch) | |
| tree | cd59220cf88af3e1dfc42f50a0eb1956cc6e433a | |
| parent | 0ca752f9471a6dee173dec810c0749f4214e5304 (diff) | |
slightly more robust cabal file reading
| -rw-r--r-- | src/Propellor/DotDir.hs | 6 |
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 |
