refactor: move ensureCtx closer to usage
This commit is contained in:
@ -47,7 +47,6 @@ var RecipeFetchCommand = &cobra.Command{
|
||||
log.Fatal("cannot use [recipe] and --all/-a together")
|
||||
}
|
||||
|
||||
ensureCtx := internal.GetEnsureContext()
|
||||
if recipeName != "" {
|
||||
r := recipe.Get(recipeName)
|
||||
if _, err := os.Stat(r.Dir); !os.IsNotExist(err) {
|
||||
@ -91,6 +90,7 @@ var RecipeFetchCommand = &cobra.Command{
|
||||
}
|
||||
|
||||
catlBar := formatter.CreateProgressbar(len(catalogue), "fetching latest recipes...")
|
||||
ensureCtx := internal.GetEnsureContext()
|
||||
for recipeName := range catalogue {
|
||||
r := recipe.Get(recipeName)
|
||||
if err := r.Ensure(ensureCtx); err != nil {
|
||||
|
Reference in New Issue
Block a user