/** * Run our command. Set up the environment, as needed, ensuring that * it is restored at the end of the run. */ public function run($stdoutFile = '') { $commandString = $this->getCommandString(); // print ">> $commandString\n"; $origEnv = $this->env->apply($this->env); $origDir = FileSystemUtils::applyDir($this->dir); $exitCode = static::runCommand($commandString, $stdoutFile); $origEnv->apply(); FileSystemUtils::applyDir($origDir); return $exitCode; }