forked from coop-cloud/abra
refactor: use passed down conf to decide
This commit is contained in:
parent
d4f3a7be31
commit
992e675921
|
@ -42,11 +42,9 @@ func ValidateRecipe(c *cli.Context, opts ...runtime.Option) recipe.Recipe {
|
|||
}
|
||||
}
|
||||
|
||||
if conf.EnsureRecipeLatest {
|
||||
if err := recipe.EnsureLatest(recipeName, conf); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
|
@ -110,11 +108,9 @@ func ValidateRecipeWithPrompt(c *cli.Context, opts ...runtime.Option) recipe.Rec
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if conf.EnsureRecipeLatest {
|
||||
if err := recipe.EnsureLatest(recipeName, conf); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
|
|
|
@ -339,6 +339,10 @@ func EnsureVersion(recipeName, version string) error {
|
|||
|
||||
// EnsureLatest makes sure the latest commit is checked out for a local recipe repository
|
||||
func EnsureLatest(recipeName string, conf *runtime.Config) error {
|
||||
if !conf.EnsureRecipeLatest {
|
||||
return nil
|
||||
}
|
||||
|
||||
recipeDir := path.Join(config.RECIPES_DIR, recipeName)
|
||||
|
||||
isClean, err := gitPkg.IsClean(recipeDir)
|
||||
|
|
Loading…
Reference in New Issue