Skip to content

Commit 710e278

Browse files
kayw-geeknicolas-grekas
authored andcommitted
Fix the command -v exception when the command option with a dash prefix
1 parent 8bda0be commit 710e278

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ExecutableFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function find(string $name, ?string $default = null, array $extraDirs = [
7272
}
7373
}
7474

75-
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
75+
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v --';
7676
if (\function_exists('exec') && ($executablePath = strtok(@exec($command.' '.escapeshellarg($name)), \PHP_EOL)) && @is_executable($executablePath)) {
7777
return $executablePath;
7878
}

0 commit comments

Comments
 (0)