fix: bail out if app doesn't exist
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/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"))
|
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")
|
ed, ok := os.LookupEnv("EDITOR")
|
||||||
if !ok {
|
if !ok {
|
||||||
edPrompt := &survey.Select{
|
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 := exec.Command(ed, appFiles[appName].Path)
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user