refactor: centralise app name validation

This commit is contained in:
2021-09-05 22:04:48 +02:00
parent cc249e8187
commit ec40d88134
15 changed files with 41 additions and 82 deletions

View File

@ -1,7 +1,6 @@
package app
import (
"errors"
"os"
"os/exec"
@ -17,10 +16,7 @@ var appConfigCommand = &cli.Command{
Aliases: []string{"c"},
Usage: "Edit app config",
Action: func(c *cli.Context) error {
appName := c.Args().First()
if appName == "" {
internal.ShowSubcommandHelpAndError(c, errors.New("no app name provided"))
}
appName := internal.ValidateAppNameArg(c)
appFiles, err := config.LoadAppFiles("")
if err != nil {