protected function systemInDirectory($call, $target_dir) { if (!$this->getTasks()->pretend()) { $old_dir = getcwd(); chdir($target_dir); } $result = $this->system($call); if (!$this->getTasks()->pretend()) { chdir($old_dir); } return $result; }