abstract class CommandStack extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecCommand;
+ use \Robo\Common\CommandReceiver;
/**
* @var string
*/
public function getCommand()
{
- return implode(' && ', $this->exec);
+ $commands = [];
+ foreach ($this->exec as $command) {
+ $commands[] = $this->receiveCommand($command);
+ }
+
+ return implode(' && ', $commands);
}
/**
}
/**
- * @param string|string[] $command
+ * @param string|string[]|CommandInterface $command
*
* @return $this
*/
$command = implode(' ', array_filter($command));
}
- $command = $this->executable . ' ' . $this->stripExecutableFromCommand($command);
- $this->exec[] = trim($command);
+ if (is_string($command)) {
+ $command = $this->executable . ' ' . $this->stripExecutableFromCommand($command);
+ $command = trim($command);
+ }
+
+ $this->exec[] = $command;
+
return $this;
}