Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
[Editor] Improve editor prompt (#140)
Browse files Browse the repository at this point in the history
* [Editor] Improve editor prompt

Add support 'Editor' variable for input custom editor cli

* Update editor.go

* Update comment
  • Loading branch information
Kamontat Chantrachirathumrong authored and AlecAivazis committed Jun 6, 2018
1 parent e752db4 commit 4c5c08b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Editor struct {
Message string
Default string
Help string
Editor string
HideDefault bool
AppendDefault bool
}
Expand Down Expand Up @@ -143,6 +144,11 @@ func (e *Editor) Prompt() (interface{}, error) {
return "", err
}

// check is input editor exist
if e.Editor != "" {
editor = e.Editor
}

// open the editor
cmd := exec.Command(editor, f.Name())
cmd.Stdin = os.Stdin
Expand Down

0 comments on commit 4c5c08b

Please sign in to comment.