From 36f73c1051bcddaf4f93e8d2107e1ed0d78e8a30 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 5 Jun 2018 01:01:31 -0600 Subject: [PATCH] use only editor basename, not full path --- usr/share/install_helper.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index e38972e..dbb3228 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -52,17 +52,19 @@ read_cmd="read -u 3" # TODO detect if rsync is available and use rsync -a (more portable) rsync_cmd="cp -pPR" -my_edit=${EDITOR:-} set +e -my_edit=$(type -p edit) +my_edit=$(basename "${EDITOR:-}") if [ -z "$my_edit" ]; then - my_edit=$(type -p nano) + my_edit=$(basename "$(type -p edit)") fi if [ -z "$my_edit" ]; then - my_edit=$(type -p vim) + my_edit=$(basename "$(type -p nano)") fi if [ -z "$my_edit" ]; then - my_edit=$(type -p vi) + my_edit=$(basename "$(type -p vim)") +fi +if [ -z "$my_edit" ]; then + my_edit=$(basename "$(type -p vi)") fi set -e