3 namespace Robo\Task\Gulp;
5 use Robo\Task\BaseTask;
6 use Robo\Exception\TaskException;
7 use Robo\Common\ProcessUtils;
9 abstract class Base extends BaseTask
11 use \Robo\Common\ExecOneCommand;
16 protected $command = '';
29 * adds `silent` option to gulp
33 public function silent()
35 $this->option('silent');
40 * adds `--no-color` option to gulp
44 public function noColor()
46 $this->option('no-color');
51 * adds `--color` option to gulp
55 public function color()
57 $this->option('color');
62 * adds `--tasks-simple` option to gulp
66 public function simple()
68 $this->option('tasks-simple');
74 * @param null|string $pathToGulp
76 * @throws \Robo\Exception\TaskException
78 public function __construct($task, $pathToGulp = null)
81 $this->command = $pathToGulp;
82 if (!$this->command) {
83 $this->command = $this->findExecutable('gulp');
85 if (!$this->command) {
86 throw new TaskException(__CLASS__, "Gulp executable not found.");
93 public function getCommand()
95 return "{$this->command} " . ProcessUtils::escapeArgument($this->task) . "{$this->arguments}";