diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2014-02-19 16:50:35 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2015-07-02 18:26:37 +0200 |
commit | 054752328b379f31be4eaeee105966bec78492ac (patch) | |
tree | 130706fe6fafd7fd68ad7c5890df3e5b8a99fca9 | |
parent | 18b2ca19ade523d8f81cfdfd4f9f4591d69a12df (diff) |
Use vim if EDITOR is not set
-rwxr-xr-x | kvm-wrapper.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh index aa43aab..e5dc4fc 100755 --- a/kvm-wrapper.sh +++ b/kvm-wrapper.sh @@ -737,7 +737,7 @@ function kvm_list () function kvm_edit_descriptor () { - [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor." + EDITOR=${EDITOR-vim} kvm_init_env "$1" test_file "$VM_DESCRIPTOR" && "$EDITOR" "$VM_DESCRIPTOR" } @@ -953,7 +953,6 @@ function kvm_build_vm () "-e"|"--edit"|"--edit-conf") local EDIT_CONF="yes" shift - [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor." ;; "--no-bootstrap") local DISABLE_BOOTSTRAP="yes" @@ -1050,7 +1049,7 @@ function kvm_remove_vm () function kvm_edit_conf () { - [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor." + EDITOR=${EDITOR-vim} eval "$EDITOR" "$CONFFILE" } |