More possibilities with truncate folder marker
This commit is contained in:
parent
5cc2d51b58
commit
9f4772f993
2 changed files with 27 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue