forked from toolshed/abra
fix: sync recipes from remotes
This commit is contained in:
@ -25,7 +25,7 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
||||
ShowSubcommandHelpAndError(c, errors.New("no recipe provided"))
|
||||
}
|
||||
|
||||
recipe, err := recipe.Get(recipeName)
|
||||
chosenRecipe, err := recipe.Get(recipeName)
|
||||
if err != nil {
|
||||
if c.Command.Name == "generate" {
|
||||
if strings.Contains(err.Error(), "missing a compose") {
|
||||
@ -37,9 +37,13 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Debugf("validated '%s' as recipe argument", recipeName)
|
||||
if err := recipe.EnsureUpToDate(recipeName); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
return recipe
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
return chosenRecipe
|
||||
}
|
||||
|
||||
// ValidateRecipeWithPrompt ensures a recipe argument is present before
|
||||
@ -93,14 +97,18 @@ func ValidateRecipeWithPrompt(c *cli.Context) recipe.Recipe {
|
||||
ShowSubcommandHelpAndError(c, errors.New("no recipe provided"))
|
||||
}
|
||||
|
||||
recipe, err := recipe.Get(recipeName)
|
||||
chosenRecipe, err := recipe.Get(recipeName)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.EnsureUpToDate(chosenRecipe.Name); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
return recipe
|
||||
return chosenRecipe
|
||||
}
|
||||
|
||||
// ValidateApp ensures the app name arg is valid.
|
||||
@ -125,6 +133,10 @@ func ValidateApp(c *cli.Context) config.App {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ssh.EnsureHostKey(app.Server); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user