From fbbb3590c7f6eca69a5c77a5215c29363595cd0d Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 12 Oct 2018 00:41:38 +0200 Subject: Move 'mightExist' to Common module --- src/CabalHelper/Shared/Common.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/CabalHelper/Shared/Common.hs') diff --git a/src/CabalHelper/Shared/Common.hs b/src/CabalHelper/Shared/Common.hs index 8e8418b..d60e745 100644 --- a/src/CabalHelper/Shared/Common.hs +++ b/src/CabalHelper/Shared/Common.hs @@ -162,3 +162,8 @@ readPackageDescription = P.readGenericPackageDescription #else readPackageDescription = P.readPackageDescription #endif + +mightExist :: FilePath -> IO (Maybe FilePath) +mightExist f = do + exists <- doesFileExist f + return $ if exists then (Just f) else (Nothing) -- cgit v1.2.3