diff --git a/src/Executable.php b/src/Executable.php index be44301..c267f66 100644 --- a/src/Executable.php +++ b/src/Executable.php @@ -22,7 +22,7 @@ public function __construct(string $program, string $cwd) public function exec(string $command, string ...$args): string { - $commandLine = $this->executable . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args)); + $commandLine = escapeshellarg($this->executable) . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args)); $process = new Process($commandLine, $this->cwd); $process->mustRun(); return $process->getOutput() . $process->getErrorOutput();