Script-Style Shell Commands

Invoke a command script-style: synchronously with forwarded stdout/in/err
from any working directory. Or capture the output instead. Automatically
throw on non-zero status code if you want.

One simple call, run,
to run a shell command script-style (ie, synchronously with forwarded stdout/in/err)
from any working directory, and automatically throw if it fails. Or
runCollect
to capture the output instead of displaying it. Or
tryRun/tryRunCollect
if you want to receive the status code instead of automatically throwing on non-zero.

Note, if you choose to use this, you still must ensure your program logic
behaves sanely in dry-run mode.

scriptlikeDryRun = true;
// When dry-run is enabled, this echoes but doesn't actually copy or invoke DMD.
copy("original.d", "app.d");
run("dmd app.d -ofbin/app");
// Works fine in dry-run, since it doesn't modify the filesystem.bool isItThere = exists("another-file");
if(!scriptlikeDryRun)
{
// This won't work right if we're running in dry-run mode,// since it'll be out-of-date, if it even exists at all.auto source = read("app.d");
}