From: Joshua Spence Date: Sun, 15 Jun 2014 18:50:15 +0000 (+1000) Subject: Fix `ArcanistLesscLinter::getVersion` function. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=45c66a1a7b58575782018bc422184a6a17655d02;p=arcanist.git 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 --- diff --git a/src/lint/linter/ArcanistLesscLinter.php b/src/lint/linter/ArcanistLesscLinter.php index 810944cb..b754e1a9 100644 --- a/src/lint/linter/ArcanistLesscLinter.php +++ b/src/lint/linter/ArcanistLesscLinter.php @@ -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\d+\.\d+\.\d+)$/', $stdout, $matches)) { + $regex = '/^lessc (?P\d+\.\d+\.\d+)\b/'; + if (preg_match($regex, $stdout, $matches)) { $version = $matches['version']; } else { return false;