Spawn a child process and have it run a command.
This method should only be used when low-level access to the raw child process instance is necessary. Instead, when possible, use `executeCommand()`-- it has a much easier and much less error-prone interface. This method, on the other hand, uses the `child_process.spawn()` method from Node.js core. The success exit from this machine will be called BEFORE the command has finished running (i.e. before the resulting child process exits). Note that it is _very important_ that this method is synchronous, to ensure that the child process instance returned is available in time to bind events.
var Process = require('machinepack-process');
// Spawn a child process and have it run a command.
cliArgs: [ '-la' ],
The command to run in the child process, without any CLI arguments or options.
An array of command-line arguments (e.g. `commit` or `install`) and/or options (e.g. `-al` or `-f 7` or `--foo='bar'`) to pass in.
[ '-la' ]
The path to the directory where this command will be run.
A dictionary of environment variables to provide to the child process.
An unexpected error occurred.