fix: bail out if app doesn't exist
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Closes coop-cloud/go-abra#67. Closes coop-cloud/go-abra#69. Fix lifted from approach in coop-cloud/go-abra#69. Thanks for @knoflook!
This commit is contained in:
parent
d82f854ebd
commit
273db078b0
|
@ -22,6 +22,15 @@ var appConfigCommand = &cli.Command{
|
|||
internal.ShowSubcommandHelpAndError(c, errors.New("no app name provided"))
|
||||
}
|
||||
|
||||
appFiles, err := config.LoadAppFiles("")
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if _, ok := appFiles[appName]; !ok {
|
||||
logrus.Fatalf("'%s' doesn't exist?", appName)
|
||||
}
|
||||
|
||||
ed, ok := os.LookupEnv("EDITOR")
|
||||
if !ok {
|
||||
edPrompt := &survey.Select{
|
||||
|
@ -33,11 +42,6 @@ var appConfigCommand = &cli.Command{
|
|||
}
|
||||
}
|
||||
|
||||
appFiles, err := config.LoadAppFiles("")
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command(ed, appFiles[appName].Path)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
|
|
Loading…
Reference in New Issue