Пример #1
0
 /**
  * @expectedException \InvalidArgumentException
  */
 function testWithCwdThrowsExceptionWhenDirectoryDoesNotExist()
 {
     Path::chdir('/foo', function () {
     });
 }
Пример #2
0
 function execute($tasks)
 {
     $this->prepareEnv();
     $tasks = (array) $tasks;
     $start = microtime(true);
     foreach ($tasks as $taskName) {
         if (!($task = $this['tasks'][$taskName])) {
             throw new \InvalidArgumentException(sprintf('Task "%s" not found.', $taskName));
         }
         $this['log']->info(sprintf('Running Task "%s"', $taskName));
         if ($this->projectDirectory) {
             Path::chdir($this->projectDirectory, array($task, 'invoke'));
         } else {
             $task->invoke();
         }
     }
     $this['log']->info(sprintf('Build finished in %f seconds', microtime(true) - $start));
 }
Пример #3
0
Файл: Dsl.php Проект: chh/bob
function cd($path, $callback = null)
{
    return Path::chdir($path, $callback);
}