public function which($binary, $fallback = null, $prompt = true)
    {
        $locations = [
            $this->paths->getPath($binary),
            $this->localStorage->get($this->getBinaryStoragePath($binary)),
            $binary,
        ];

        // Add fallback if provided
        if ($fallback) {
            $locations[] = $fallback;
        }

        // Add command prompt if possible
        if ($this->hasCommand() && $prompt) {
            $prompt = 'Binary "'.$binary.'" could not be found, please enter the path to it';
            $locations[] = [$this->command, 'ask', $prompt];
        }

        return $this->whichFrom($binary, $locations);
    }