Skip to content

Commit 1a2a918

Browse files
committed
Fix mustache command
1 parent c86c2ec commit 1a2a918

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1414
`.travis.yml` file to get Behat running again. This is because Travis CI changed their default
1515
environment from Precise to Trusy. On Trusty, the default Firefox version is 55, which is not
1616
compatible with Selenium.
17+
- Fixed `moodle-plugin-ci mustache` command when `_JAVA_OPTIONS` environment variable is set.
18+
This is now set by default in Trusty builds.
1719

1820
### Added
1921
- Can now use Chrome with Behat, see [help document](Chrome.md) for details.

src/Command/MustacheCommand.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
5858

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

0 commit comments

Comments
 (0)