From: Francois Fleuret Date: Sat, 21 Jul 2012 08:36:51 +0000 (+0200) Subject: Fixed a bug when checking the existence of a dir in selector-cd-search. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=selector.git;a=commitdiff_plain;h=9ab77834b683d83a47b3f7327138ed14e3ab35cf Fixed a bug when checking the existence of a dir in selector-cd-search. --- diff --git a/bash-selector.sh b/bash-selector.sh index 87df02c..38991b1 100755 --- a/bash-selector.sh +++ b/bash-selector.sh @@ -77,7 +77,7 @@ function selector-cd-search () { PATH_TEMP=$(mktemp /tmp/selector-cd-path.XXXXXX) selector -j -y -u -t "cd" -l 1000 -d -i -c 7,2,0,3 -o ${PATH_TEMP} -q ${SELECTOR_CD_HISTORY} NEW_PATH="$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')" - if [[ -s "${NEW_PATH}" ]]; then + if [[ -d "${NEW_PATH}" ]]; then selector-cd "$(cat ${PATH_TEMP} | sed -e 's!^~!'${HOME}'!')" fi \rm ${PATH_TEMP}