]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix `ArcanistLesscLinter::getVersion` function.
authorJoshua Spence <josh@joshuaspence.com>
Sun, 15 Jun 2014 18:50:15 +0000 (04:50 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 15 Jun 2014 18:50:15 +0000 (04:50 +1000)
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

src/lint/linter/ArcanistLesscLinter.php

index 810944cb79cdb1b15267bfb27b9387c0db4e1133..b754e1a94e3eea08c625ed7f5f0913255b6067f7 100644 (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;