| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.2621 |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | 1 | public function execute($gulpCommand = NULL) |
|
| 59 | { |
||
| 60 | 1 | $path = $this->directory . DIRECTORY_SEPARATOR . $this->gulpfile; |
|
| 61 | 1 | if (!file_exists($path)) { |
|
| 62 | $this->error(sprintf("Cannot find gulpfile '%s'.", $path)); |
||
| 63 | } |
||
| 64 | |||
| 65 | 1 | $cmd = 'cd ' . escapeshellarg($this->directory) . ' && gulp ' . $gulpCommand; |
|
| 66 | 1 | $command = new Commands\Exec(); |
|
| 67 | 1 | $command->setCommand($cmd); |
|
| 68 | 1 | $result = $command->execute(); |
|
| 69 | 1 | if ($result->getResult() !== 0) { |
|
| 70 | $this->error(sprintf("Gulp task '%s' in directory %s failed.", $gulpCommand, $this->directory)); |
||
| 71 | } |
||
| 72 | 1 | return $result; |
|
| 73 | } |
||
| 74 | |||
| 75 | } |