diff --git a/cli/app/new.go b/cli/app/new.go index 13e9c831..8428b4a7 100644 --- a/cli/app/new.go +++ b/cli/app/new.go @@ -110,12 +110,14 @@ var AppNewCommand = &cobra.Command{ log.Fatal(err) } - head, err := recipe.Head() - if err != nil { - log.Fatalf("failed to retrieve latest commit for %s: %s", recipe.Name, err) - } + if recipeVersion == "" { + head, err := recipe.Head() + if err != nil { + log.Fatalf("failed to retrieve latest commit for %s: %s", recipe.Name, err) + } - recipeVersion = formatter.SmallSHA(head.String()) + recipeVersion = formatter.SmallSHA(head.String()) + } } }