BuildBox.Command.File
Description
Working with the file system.
Documentation
Properties of the file system we can test for.
inDir :: FilePath -> Build a -> Build aSource
Run a command in a different working directory. Throws an error if the directory doesn't exist.
inScratchDir :: FilePath -> Build a -> Build aSource
Create a new directory with the given name, run a command within it, then change out and recursively delete the directory. Throws an error if a directory with the given name already exists.
clobberDir :: FilePath -> Build ()Source
Delete a dir recursively if it's there, otherwise do nothing.
Unlike removeDirectoryRecursive
, this function does
not follow symlinks, it just deletes them.
ensureDir :: FilePath -> Build ()Source
Create a new directory if it isn't already there, or return successfully if it is.
withTempFile :: (FilePath -> Build a) -> Build aSource
Create a temp file, pass it to some command, then delete the file after the command finishes.