WIP: make "abra app deploy" callable by code
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Closes coop-cloud/organising#212.
This commit is contained in:
@ -13,6 +13,9 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// AppName is used for configuring app name programmatically
|
||||
var AppName string
|
||||
|
||||
// ValidateRecipe ensures the recipe arg is valid.
|
||||
func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
||||
recipeName := c.Args().First()
|
||||
@ -59,7 +62,7 @@ func ValidateRecipeWithPrompt(c *cli.Context) recipe.Recipe {
|
||||
logrus.Debugf("programmatically setting recipe name to %s", recipeName)
|
||||
}
|
||||
|
||||
if recipeName == "" && RecipeName == "" {
|
||||
if recipeName == "" {
|
||||
ShowSubcommandHelpAndError(c, errors.New("no recipe provided"))
|
||||
}
|
||||
|
||||
@ -77,6 +80,11 @@ func ValidateRecipeWithPrompt(c *cli.Context) recipe.Recipe {
|
||||
func ValidateApp(c *cli.Context) config.App {
|
||||
appName := c.Args().First()
|
||||
|
||||
if appName == "" && AppName != "" {
|
||||
appName = AppName
|
||||
logrus.Debugf("programmatically setting app name to %s", appName)
|
||||
}
|
||||
|
||||
if appName == "" {
|
||||
ShowSubcommandHelpAndError(c, errors.New("no app provided"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user