buildbox-1.0.1.1: Rehackable components for writing buildbots and test harnesses.

BuildBox.Command.File

Description

Working with the file system.

Synopsis

Documentation

data PropFile Source

Properties of the file system we can test for.

Constructors

HasExecutable String

Some executable is in the current path.

HasFile FilePath

Some file exists.

HasDir FilePath

Some directory exists.

FileEmpty FilePath

Some file is empty.

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.