Exemplo n.º 1
0
 /**
  * Get the command with options and arguments
  *
  * @return string
  */
 protected function getCommand()
 {
     $cmd = $this->get('command');
     $argv = substr(parent::getCommand(), strlen($cmd)) . ' ';
     if (strpos($argv, ' --no-ansi ') === false && strpos($argv, ' --ansi ') === false && $this->console->getOutput()->isDecorated()) {
         $argv = ' --ansi' . $argv;
     }
     if (!$this->shouldExecute() && strpos($argv, ' --dry-run ') === false) {
         $argv = ' --dry-run' . $argv;
     }
     return $cmd . rtrim($argv);
 }
Exemplo n.º 2
0
 /**
  * Infere command to gitCommand
  *
  * @param string $name  Name
  * @param mixed  $value Value
  *
  * @return void
  */
 public function offsetSet($name, $value)
 {
     if ($name === 'command') {
         if (is_array($value)) {
             foreach ($value as &$item) {
                 $item = 'git ' . $item;
             }
         } else {
             $value = 'git ' . $value;
         }
     }
     parent::offsetSet($name, $value);
 }