1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 02:02:40 +01:00

Fix ArcanistLesscLinter::getVersion function.

Summary:
This `ArcanistLesscLinter::getCacheVersion` should have been renamed to `getVersion` as of D8971, but wasn't updated.

Also fix the regex to properly capture version information.

Test Plan: It's pretty difficult to test this stuff.... I have an idea that I will submit a separate diff for.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9475
This commit is contained in:
Joshua Spence 2014-06-16 04:50:15 +10:00
parent af8bdb2b94
commit 45c66a1a7b

View file

@ -86,11 +86,12 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
return 'lessc';
}
public function getCacheVersion() {
public function getVersion() {
list($stdout) = execx('%C --version', $this->getExecutableCommand());
$matches = array();
if (preg_match('/^lessc (?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) {
$regex = '/^lessc (?P<version>\d+\.\d+\.\d+)\b/';
if (preg_match($regex, $stdout, $matches)) {
$version = $matches['version'];
} else {
return false;