
| Current Path : /var/www/html/ift/vendor/consolidation/robo/src/Task/Gulp/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/ift/vendor/consolidation/robo/src/Task/Gulp/Base.php |
<?php
namespace Robo\Task\Gulp;
use Robo\Task\BaseTask;
use Robo\Exception\TaskException;
use Robo\Common\ProcessUtils;
abstract class Base extends BaseTask
{
use \Robo\Common\ExecOneCommand;
/**
* @var string
*/
protected $command = '';
/**
* @var array
*/
protected $opts = [];
/**
* @var string
*/
protected $task = '';
/**
* adds `silent` option to gulp
*
* @return $this
*/
public function silent()
{
$this->option('silent');
return $this;
}
/**
* adds `--no-color` option to gulp
*
* @return $this
*/
public function noColor()
{
$this->option('no-color');
return $this;
}
/**
* adds `--color` option to gulp
*
* @return $this
*/
public function color()
{
$this->option('color');
return $this;
}
/**
* adds `--tasks-simple` option to gulp
*
* @return $this
*/
public function simple()
{
$this->option('tasks-simple');
return $this;
}
/**
* @param string $task
* @param null|string $pathToGulp
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($task, $pathToGulp = null)
{
$this->task = $task;
$this->command = $pathToGulp;
if (!$this->command) {
$this->command = $this->findExecutable('gulp');
}
if (!$this->command) {
throw new TaskException(__CLASS__, "Gulp executable not found.");
}
}
/**
* @return string
*/
public function getCommand()
{
return "{$this->command} " . ProcessUtils::escapeArgument($this->task) . "{$this->arguments}";
}
}