Support paths like "<path>/.." in abs_dirname()
Happens e.g. in tests
This commit is contained in:
parent
83ce1df72d
commit
0342effca6
@ -81,7 +81,12 @@ abs_dirname() {
|
|||||||
cd "$cd_path"
|
cd "$cd_path"
|
||||||
fi
|
fi
|
||||||
name="${path##*/}"
|
name="${path##*/}"
|
||||||
path="$(resolve_link "$name" || true)"
|
if [[ $name == ".." ]]; then
|
||||||
|
cd ..
|
||||||
|
path="$PWD"
|
||||||
|
else
|
||||||
|
path="$(resolve_link "$name" || true)"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$PWD"
|
echo "$PWD"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user