mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-16 16:58:38 +01:00
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
This commit is contained in:
parent
b52f3fafe3
commit
7c56fad48f
1 changed files with 5 additions and 2 deletions
|
@ -49,11 +49,14 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getVersion() {
|
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();
|
$matches = array();
|
||||||
$regex = '/^jshint v(?P<version>\d+\.\d+\.\d+)$/';
|
$regex = '/^jshint v(?P<version>\d+\.\d+\.\d+)$/';
|
||||||
if (preg_match($regex, $stdout, $matches)) {
|
if (preg_match($regex, $stderr, $matches)) {
|
||||||
return $matches['version'];
|
return $matches['version'];
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue