module IO.CreateAndWriteFile
(
createAndWriteFile
)
where
import System.Directory (createDirectoryIfMissing)
import System.FilePath.Posix (takeDirectory)
import qualified Data.Text.Lazy as L (Text)
import qualified Data.Text.Lazy.IO as LIO (writeFile)
createAndWriteFile :: FilePath -> L.Text -> IO ()
createAndWriteFile :: FilePath -> Text -> IO ()
createAndWriteFile FilePath
path Text
content = do
Bool -> FilePath -> IO ()
createDirectoryIfMissing Bool
True (FilePath -> IO ()) -> FilePath -> IO ()
forall a b. (a -> b) -> a -> b
$ FilePath -> FilePath
takeDirectory FilePath
path
FilePath -> Text -> IO ()
LIO.writeFile FilePath
path Text
content