Esempio n. 1
0
 /**
  * Execute a single task
  *
  * @param Context $context
  *
  * @return void
  */
 protected function executeTaskrunner(Context $context)
 {
     $this->io->write('');
     $this->io->increaseIndention(1);
     $this->taskRunner->execute($context->getTarget(), $context->getVersion());
     $this->io->decreaseIndention(1);
 }
Esempio n. 2
0
 /**
  * Removes empty directories
  *
  * @param $cwd
  * @param $file
  */
 protected function removeEmptyDirectories($cwd, $file)
 {
     $filesystem = new Filesystem();
     $filename = sprintf('%s/%s', rtrim($cwd, DIRECTORY_SEPARATOR), $file);
     while ('.' !== dirname($file)) {
         $file = dirname($file);
         $filename = dirname($filename);
         $finder = new Finder();
         $countFiles = $finder->files()->in($filename)->ignoreDotFiles(false)->ignoreVCS(false)->count();
         if ($countFiles === 0) {
             $filesystem->remove($filename);
             if ($this->io && $this->io->isVerbose()) {
                 $this->output(sprintf("Removed %s", $file));
             }
         } else {
             return;
         }
     }
 }