refactor: use new internal arg failure func

This commit is contained in:
2021-08-03 13:57:12 +02:00
parent 43238d379c
commit 471c982f63
4 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package recipe
import (
"errors"
"fmt"
"os"
"path"
@ -9,6 +10,7 @@ import (
"coopcloud.tech/abra/catalogue"
"coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/config"
"github.com/go-git/go-git/v5"
@ -46,7 +48,7 @@ var recipeVersionCommand = &cli.Command{
Action: func(c *cli.Context) error {
recipe := c.Args().First()
if recipe == "" {
return cli.ShowSubcommandHelp(c)
internal.ShowSubcommandHelpAndError(c, errors.New("no recipe provided"))
}
catalogue, err := catalogue.ReadAppsCatalogue()
@ -81,7 +83,7 @@ var recipeCreateCommand = &cli.Command{
Action: func(c *cli.Context) error {
recipe := c.Args().First()
if recipe == "" {
return cli.ShowSubcommandHelp(c)
internal.ShowSubcommandHelpAndError(c, errors.New("no recipe provided"))
}
directory := path.Join(config.APPS_DIR, recipe)