From 45c66a1a7b58575782018bc422184a6a17655d02 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 16 Jun 2014 04:50:15 +1000 Subject: [PATCH] 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 --- src/lint/linter/ArcanistLesscLinter.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.43.0