Merge branch 'rocky-linux:main' into main

This commit is contained in:
skip77 2023-02-27 16:32:24 -05:00 committed by GitHub
commit f4f2a0a9e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -498,6 +498,11 @@ func (g *GitMode) ImportName(pd *data.ProcessData, md *data.ModeData) string {
func ProcessUrl(cdnUrl string, name string, branch string, hash string, hashtype string, filename string) (string, bool) {
tmpUrl := Lookaside{name, branch, hash, hashtype, filename}
// Return cdnUrl as-is if we don't have any templates ("{{ .Variable }}") to process:
if !(strings.Contains(cdnUrl, "{{") && strings.Contains(cdnUrl, "}}")) {
return cdnUrl, false
}
// If we run into trouble with our template parsing, we'll just return the cdnUrl, exactly as we found it
tmpl, err := template.New("").Parse(cdnUrl)
if err != nil {