diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-11-16 21:43:05 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-11-16 21:43:05 -0500 |
commit | a2856ec97944646b04d11288a1bd15e0c238c9c3 (patch) | |
tree | 7a460bab1928f4bbc03c649ddcdf2b4e86e3beee | |
parent | 0b63a7e78a407d4a8493f5b38231ac0eed404b9e (diff) | |
download | keyringer-a2856ec97944646b04d11288a1bd15e0c238c9c3.tar.gz keyringer-a2856ec97944646b04d11288a1bd15e0c238c9c3.tar.bz2 |
fall back on reasonable editors if environment variable is not set
-rw-r--r-- | lib/keyringer/functions | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 5c4b5da..9888ed1 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -187,10 +187,15 @@ function keyringer_set_env { fi if [ -z "$EDITOR" ]; then - echo "You have to set EDITOR env variable" - exit 1 + if type sensible-editor > /dev/null 2>&1 ; then + EDITOR=sensible-editor + elif type editor > /dev/null 2>&1 ; then + EDITOR=editor + else + echo "You have to set EDITOR env variable" + exit 1 + fi fi - if [ ! -f "$OPTIONS" ]; then echo "No option config was found" exit 1 |