Skip to content

Commit

Permalink
release: fix $EDITOR handling (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker committed Feb 5, 2024
1 parent 4c461b2 commit ecee5e3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/release/main.go
Expand Up @@ -233,7 +233,16 @@ func editFileInteractive(path string) error {
if e := os.Getenv("EDITOR"); e != "" {
editor = e
}
return execCommand(os.Stdout, editor, path)
return execShellCommand(os.Stdout, fmt.Sprintf("%s %s", editor, path))
}

func execShellCommand(stdout io.Writer, command string) error {
shell := "sh"
if s := os.Getenv("SHELL"); s != "" {
shell = s
}

return execCommand(stdout, shell, "-c", command)
}

func execCommand(stdout io.Writer, name string, args ...string) error {
Expand Down

0 comments on commit ecee5e3

Please sign in to comment.