module Utils.Drasil.Directory (createDirIfMissing) where
import System.Directory (createDirectoryIfMissing, doesPathExist)
createDirIfMissing :: Bool -> FilePath -> IO ()
createDirIfMissing :: Bool -> FilePath -> IO ()
createDirIfMissing Bool
withParents FilePath
path = do
Bool
exists <- FilePath -> IO Bool
doesPathExist FilePath
path
if Bool
exists
then () -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
else Bool -> FilePath -> IO ()
createDirectoryIfMissing Bool
withParents FilePath
path