Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelle-S committed Sep 29, 2017
2 parents 59f796f + d8d45e2 commit 08afd0a
Show file tree
Hide file tree
Showing 5 changed files with 1,865 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Commands/ThemeCompile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ trait ThemeCompile
{
use \DigipolisGent\Robo\Task\Package\Traits\ThemeCompileTrait;

public function digipolisThemeCompile($dir = null, $command = 'compile')
public function digipolisThemeCompile($dir = null, $buildCommand = 'compile')
{
if (is_callable([$this, 'readProperties'])) {
$this->readProperties();
}
$this->taskThemeCompile($dir, $command)->run();
$this->taskThemeCompile($dir, $buildCommand)->run();
}
}
4 changes: 4 additions & 0 deletions src/ThemeClean.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function run()
$result = false;
if (file_exists($this->dir . '/bower.json')) {
$bower = $this->findExecutable('bower');
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$bower = $this->findExecutable('node') . ' '
. (strpos($bower, 'call ') === 0 ? substr($bower, 5) : $bower);
}
$this->processes[] = new Process(
$this->receiveCommand($bower . ' cache clean'),
$this->dir,
Expand Down
10 changes: 7 additions & 3 deletions src/ThemeCompile.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public function run()
);
}
if (file_exists($this->dir . '/package.json')) {
$npm = $this->findExecutable('npm');
$executable = $this->findExecutable(file_exists($this->dir . '/yarn.lock') ? 'yarn' : 'npm');
$this->processes[] = new Process(
$this->receiveCommand($npm . ' install'),
$this->receiveCommand($executable . ' install'),
$this->dir,
null,
null,
Expand All @@ -68,12 +68,16 @@ public function run()

// Grunt/gulp and bower must wait for the previous processes to finish.
$result = parent::run();
if (!$result->getExitCode() === 0) {
if ($result->getExitCode() !== 0) {
return $result;
}
$this->processes = [];
if (file_exists($this->dir . '/bower.json')) {
$bower = $this->findExecutable('bower');
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$bower = $this->findExecutable('node') . ' '
. (strpos($bower, 'call ') === 0 ? substr($bower, 5) : $bower);
}
$this->processes[] = new Process(
$this->receiveCommand($bower . ' install'),
$this->dir,
Expand Down
Loading

0 comments on commit 08afd0a

Please sign in to comment.