Skip to content

Commit

Permalink
Merge pull request #2 from arush-sal/dev
Browse files Browse the repository at this point in the history
add check for editor env variable
  • Loading branch information
crosbymichael committed Nov 19, 2019
2 parents 502f2bb + aeb2497 commit 78698aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bulk.go
Expand Up @@ -149,6 +149,11 @@ func tempFile(path string, results []*extInfo) (string, error) {

func startEditor(path string) error {
editor := os.Getenv("EDITOR")
if editor == "" {
return errors.New(`no default editor set.
please set a default editor of your choice. e.g:
export EDITOR=vim`)
}
cmd := exec.Command(editor, path)
cmd.Env = os.Environ()
cmd.Stdin = os.Stdin
Expand Down

0 comments on commit 78698aa

Please sign in to comment.