module Mit.Directory
( cd,
doesDirectoryExist,
)
where
import Data.Text qualified as Text
import Mit.Monad
import Mit.Prelude
import System.Directory qualified as Directory
cd :: Text -> Mit r (X x a) a -> Mit r x a
cd :: forall r x a. Text -> Mit r (X x a) a -> Mit r x a
cd Text
dir =
forall r x a.
(forall v. IO v -> IO v) -> Mit r (X x a) a -> Mit r x a
with_ (forall a. FilePath -> IO a -> IO a
Directory.withCurrentDirectory (Text -> FilePath
Text.unpack Text
dir))
doesDirectoryExist :: MonadIO m => Text -> m Bool
doesDirectoryExist :: forall (m :: * -> *). MonadIO m => Text -> m Bool
doesDirectoryExist =
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. FilePath -> IO Bool
Directory.doesDirectoryExist forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> FilePath
Text.unpack