Commit 0a48bcb6 authored by Valentin Samir's avatar Valentin Samir

[.bashrc] Stop find_up if directory does not exist

parent f1116cc0
......@@ -45,12 +45,17 @@ fi
# des infos quand on est dans un dépôt versionné
find_up () {
local path normalized_path normalized_ret
path="$1"
shift 1
while [[ "`readlink -f -- \"$path\"`" != "/" ]];
normalized_path=`readlink -f -- "$path"`
normalized_ret=$?
while [[ "$normalized_path" != "/" ]] && [ $normalized_ret -eq 0 ];
do
find "$path" -maxdepth 1 -mindepth 1 "$@"
path=${path}/..
normalized_path=`readlink -f -- "$path"`
normalized_ret=$?
done
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment