8000 Fix the `command -v` exception when the command option with a dash pr… · symfony/symfony@851f2f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 851f2f0

Browse files
committed
Fix the command -v exception when the command option with a dash prefix
1 parent b6d7264 commit 851f2f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Process/ExecutableFinder.php

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

71-
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
71+
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v --';
7272
if (\function_exists('exec') && ($executablePath = strtok(@exec($command.' '.escapeshellarg($name)), \PHP_EOL)) && @is_executable($executablePath)) {
7373
return $executablePath;
7474
}

0 commit comments

Comments
 (0)
0