diff --git a/config_cmd.go b/config_cmd.go index 800524f..122d982 100644 --- a/config_cmd.go +++ b/config_cmd.go @@ -27,6 +27,11 @@ var configCmd = &cobra.Command{ Example: formatBlock("glow config\nglow config --config path/to/config.yml"), Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + editor := os.Getenv("EDITOR") + if editor == "" { + return errors.New("no EDITOR environment variable set") + } + if configFile == "" { scope := gap.NewScope(gap.User, "glow") @@ -61,11 +66,6 @@ var configCmd = &cobra.Command{ return err } - editor := os.Getenv("EDITOR") - if editor == "" { - return errors.New("no EDITOR environment variable set") - } - c := exec.Command(editor, configFile) c.Stdin = os.Stdin c.Stdout = os.Stdout