Fixed a bug when checking the existence of a dir in selector-cd-search.
authorFrancois Fleuret <francois@fleuret.org>
Sat, 21 Jul 2012 08:36:51 +0000 (10:36 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Sat, 21 Jul 2012 08:36:51 +0000 (10:36 +0200)
bash-selector.sh

index 87df02c..38991b1 100755 (executable)
@@ -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}