2 namespace Robo\Task\Bower;
4 use Robo\Task\BaseTask;
5 use Robo\Exception\TaskException;
7 abstract class Base extends BaseTask
9 use \Robo\Common\ExecOneCommand;
12 protected $action = '';
17 protected $command = '';
20 * adds `allow-root` option to bower
24 public function allowRoot()
26 $this->option('allow-root');
31 * adds `force-latest` option to bower
35 public function forceLatest()
37 $this->option('force-latest');
42 * adds `production` option to bower
46 public function noDev()
48 $this->option('production');
53 * adds `offline` option to bower
57 public function offline()
59 $this->option('offline');
66 * @param null|string $pathToBower
68 * @throws \Robo\Exception\TaskException
70 public function __construct($pathToBower = null)
72 $this->command = $pathToBower;
73 if (!$this->command) {
74 $this->command = $this->findExecutable('bower');
76 if (!$this->command) {
77 throw new TaskException(__CLASS__, "Bower executable not found.");
84 public function getCommand()
86 return "{$this->command} {$this->action}{$this->arguments}";