parent
2cb0fb8d66
commit
87f0985ebb
|
@ -69,10 +69,18 @@ func EnsureExists(recipe string) error {
|
|||
if _, err := os.Stat(recipeDir); os.IsNotExist(err) {
|
||||
url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, recipe)
|
||||
_, err := git.PlainClone(recipeDir, false, &git.CloneOptions{URL: url, Tags: git.AllTags})
|
||||
if err != nil {
|
||||
// try with main branch because Git is being a Git
|
||||
_, err := git.PlainClone(recipeDir, false, &git.CloneOptions{
|
||||
URL: url,
|
||||
Tags: git.AllTags,
|
||||
ReferenceName: plumbing.ReferenceName("refs/heads/main"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue