Skip to content

Commit

Permalink
Fix mustache command
Browse files Browse the repository at this point in the history
  • Loading branch information
polothy committed Sep 13, 2017
1 parent c86c2ec commit 1a2a918
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
`.travis.yml` file to get Behat running again. This is because Travis CI changed their default
environment from Precise to Trusy. On Trusty, the default Firefox version is 55, which is not
compatible with Selenium.
- Fixed `moodle-plugin-ci mustache` command when `_JAVA_OPTIONS` environment variable is set.
This is now set by default in Trusty builds.

### Added
- Can now use Chrome with Behat, see [help document](Chrome.md) for details.
Expand Down
8 changes: 7 additions & 1 deletion src/Command/MustacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ protected function execute(InputInterface $input, OutputInterface $output)

$code = 0;
foreach ($files as $file) {
// _JAVA_OPTIONS is something Travis CI started to set in Trusty. This breaks Mustache because
// the output from vnu.jar needs to be captured and JSON decoded. When _JAVA_OPTIONS is present,
// then a message like "Picked up _JAVA_OPTIONS..." is printed which breaks JSON decoding.
$process = $this->execute->passThroughProcess(
ProcessBuilder::create()
->setPrefix('php')
->add('env')
->add('-u')
->add('_JAVA_OPTIONS')
->add('php')
->add($wrapper)
->add('--filename='.$file)
->add('--validator='.$jarFile)
Expand Down

0 comments on commit 1a2a918

Please sign in to comment.