Skip to content

Commit

Permalink
Fix Default cdn behavior (#9)
Browse files Browse the repository at this point in the history
- CDN returned as-is for processing if no template indicators are found

-Skip G.
  • Loading branch information
skip77 authored Feb 27, 2023
1 parent 2c6d6f0 commit 5e8ed2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/modes/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5e8ed2e

Please sign in to comment.