More possibilities with truncate folder marker

This commit is contained in:
Benoit Averty
2017-01-31 23:49:46 +01:00
committed by Dominik Ritter
parent 5cc2d51b58
commit 9f4772f993
2 changed files with 27 additions and 20 deletions
+9 -8
View File
@@ -211,15 +211,16 @@ function truncatePathFromRight() {
# Search recursively in parent folders for given file.
function upsearch () {
if test -e "$1"; then
if [[ "$PWD" == "$HOME" || "$PWD" == "/" ]]; then
echo "$PWD"
elif test -e "$1"; then
pushd .. > /dev/null
upsearch "$1"
popd > /dev/null
echo "$PWD"
else
if [[ "$PWD" == "/" || "$PWD" == "$HOME" ]]; then
echo "$PWD";
else
pushd .. > /dev/null
upsearch "$1"
popd > /dev/null
fi
pushd .. > /dev/null
upsearch "$1"
popd > /dev/null
fi
}