protected function determineRemoteFilename($updateVersion)
    {
        // If sha, download from root.
        if (preg_match('{^[0-9a-f]{40}$}', $updateVersion)) {
            return $this->getBaseUrl() . '/' . $this->getPharName();
        }

        // Download from sub directory otherwise.
        return sprintf(
            '%s/download/%s/%s',
            $this->getBaseUrl(),
            $updateVersion,
            $this->getPharName()
        );
    }