function generateRawFileUrl()

in packaging/notice_generator.php [108:119]


function generateRawFileUrl($package) {
    if (isset($package['source']['type']) && $package['source']['type'] === 'git' && isset($package['source']['url']) && isset($package['source']['reference'])) {
        $repoUrl = $package['source']['url'];
        $reference = $package['source']['reference'];
        if (strpos($repoUrl, 'https://github.com/') === 0) {
            $repoUrl = str_replace('https://github.com/', 'https://raw.githubusercontent.com/', $repoUrl);
            $repoUrl = substr($repoUrl, 0, -4);
            return $repoUrl . '/' . $reference;
        }
    }
    return 'No URL';
}