Add vscode to config command editor stack and enable passing in an arbitrary editor
This commit is contained in:
parent
3d2e443108
commit
3d7011e504
@ -12,9 +12,11 @@ import (
|
||||
|
||||
var (
|
||||
configCmd = &cobra.Command{
|
||||
Use: "config",
|
||||
Use: "config [editor]",
|
||||
Short: "Edit config file",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
editors = append(args, editors...)
|
||||
|
||||
if editor := findEditor(); editor != "" {
|
||||
process := exec.Command(editor, storage.Path.Config())
|
||||
process.Stdin = os.Stdin
|
||||
@ -27,7 +29,7 @@ var (
|
||||
},
|
||||
}
|
||||
|
||||
editors = []string{"nano", "notepad", "vi", "emacs"}
|
||||
editors = []string{"nano", "code", "vi", "emacs", "notepad"}
|
||||
)
|
||||
|
||||
func findEditor() string {
|
||||
|
Loading…
Reference in New Issue
Block a user