]> khamidou — GitHub mirrors - arcanist.git/commitdiff
JSHint linter issue on windows
authorAurelijus <aurelijus@astdev.lt>
Mon, 30 Jul 2012 07:21:03 +0000 (09:21 +0200)
committerAurelijus <aurelijus@astdev.lt>
Mon, 30 Jul 2012 07:26:37 +0000 (09:26 +0200)
Summary: On windows there is no 'which', only 'where'

Test Plan: Run JSHint linter on windows and unix-like system.

Reviewers: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3096

src/lint/linter/ArcanistJSHintLinter.php

index 6d25a4dd56d66e609e57a9851caecc6dcc500560..06f0fa1c53326e6b0047155bcb8e295c8cd67089 100644 (file)
@@ -116,7 +116,8 @@ final class ArcanistJSHintLinter extends ArcanistLinter {
     }
 
     // Look for globally installed JSHint
-    list($err) = exec_manual('which %s', $bin);
+    $cmd = (phutil_is_windows()) ? 'where %s' : 'which %s';
+    list($err) = exec_manual($cmd, $bin);
     if ($err) {
       throw new ArcanistUsageException(
         "JSHint does not appear to be installed on this system. Install it ".