Skip to content
Snippets Groups Projects
Commit f692c789 authored by Francesco Gazzetta's avatar Francesco Gazzetta
Browse files

Add doesPathExist to compat module

parent 6ef25232
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE CPP #-}
module Distribution.Compat.Directory (listDirectory, makeAbsolute) where
module Distribution.Compat.Directory
( listDirectory
, makeAbsolute
, doesPathExist
) where
#if MIN_VERSION_directory(1,2,7)
import System.Directory as Dir hiding (doesPathExist)
import System.Directory (doesPathExist)
#else
import System.Directory as Dir
#endif
#if !MIN_VERSION_directory(1,2,2)
import System.FilePath as Path
#endif
......@@ -25,3 +34,11 @@ makeAbsolute p | Path.isAbsolute p = return p
return $ cwd </> p
#endif
#if !MIN_VERSION_directory(1,2,7)
doesPathExist :: FilePath -> IO Bool
doesPathExist path = (||) <$> doesDirectoryExist path <*> doesFileExist path
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment