Skip to content

Commit

Permalink
Merge pull request #16 from WeareJH/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mikeymike authored Mar 2, 2017
2 parents 0e66aab + e6beefc commit 8a361e3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/StaticsMergerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,14 @@ public static function getSubscribedEvents() : array
];
}

public function verifyEnvironment() : bool
/*
* @throws \RuntimeException When environment is invalid
*/
public function verifyEnvironment()
{
return is_executable($this->getYarnExecutablePath());
if (!is_executable($this->getYarnExecutablePath())) {
throw new \RuntimeException('Yarn is not installed or executable!');
}
}

private function getYarnExecutablePath() : string
Expand All @@ -148,10 +153,10 @@ public function staticsCompile()
chdir($this->getInstallPath($package));

$this->io->write(sprintf('<info>Installing dependencies for "%s"', $package->getPrettyName()));
$dependencyProcess = new Process($this->getYarnExecutablePath());
$dependencyProcess = new Process(sprintf('%s && npm rebuild node-sass', $this->getYarnExecutablePath()));

try {
$dependencyProcess->mustRun();
$dependencyProcess->setTimeout(300)->mustRun();
} catch (ProcessFailedException $e) {
$this->io->write($dependencyProcess->getOutput());
$this->io->write($dependencyProcess->getErrorOutput());
Expand All @@ -165,7 +170,7 @@ public function staticsCompile()
$buildProcess = new Process('node_modules/.bin/cb release');

try {
$buildProcess->mustRun();
$buildProcess->setTimeout(300)->mustRun();
} catch (ProcessFailedException $e) {
$this->io->write($buildProcess->getOutput());
$this->io->write($buildProcess->getErrorOutput());
Expand Down

0 comments on commit 8a361e3

Please sign in to comment.