From 7c56fad48fc7ff19150ed597085eee83998af3be Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Sat, 17 May 2014 18:17:47 -0700 Subject: [PATCH] Fix the `ArcanistJSHintLinter::getVersion` function. Summary: As identified by @epriestley in D9060, `jshint --version` emits version information on stderr, not stdout. Test Plan: Ran `jshint --version` locally and verified that the version information is output to stderr. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T4954 Differential Revision: https://secure.phabricator.com/D9173 --- src/lint/linter/ArcanistJSHintLinter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php index 566cf1e8..89e45259 100644 --- a/src/lint/linter/ArcanistJSHintLinter.php +++ b/src/lint/linter/ArcanistJSHintLinter.php @@ -49,11 +49,14 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter { } public function getVersion() { - list($stdout) = execx('%C --version', $this->getExecutableCommand()); + // NOTE: `jshint --version` emits version information on stderr, not stdout. + list($stdout, $stderr) = execx( + '%C --version', + $this->getExecutableCommand()); $matches = array(); $regex = '/^jshint v(?P\d+\.\d+\.\d+)$/'; - if (preg_match($regex, $stdout, $matches)) { + if (preg_match($regex, $stderr, $matches)) { return $matches['version']; } else { return false; -- 2.43.0