forked from kiss-community/kiss
kiss: Fix #279
This commit is contained in:
parent
7cb70f67ec
commit
764acdcde7
15
kiss
15
kiss
@ -153,15 +153,14 @@ pkg_owner() {
|
|||||||
resolve_path() {
|
resolve_path() {
|
||||||
_rpath=$KISS_ROOT/${1#/}
|
_rpath=$KISS_ROOT/${1#/}
|
||||||
|
|
||||||
# Attempt to resolve symlinks by using 'cd'.
|
if cd -P "${_rpath%/*}" 2>/dev/null; then
|
||||||
# If this fails, fallback to the file's parent
|
_parent=$PWD
|
||||||
# directory.
|
cd "$OLDPWD"
|
||||||
cd -P "${_rpath%/*}" 2>/dev/null || PWD=${_rpath%/*}
|
else
|
||||||
|
_parent=${_rpath%/*}
|
||||||
|
fi
|
||||||
|
|
||||||
# Final resolved path.
|
_rpath=${_parent#"$KISS_ROOT"}/${_rpath##*/}
|
||||||
_rpath=${PWD#"$KISS_ROOT"}/${_rpath##*/}
|
|
||||||
|
|
||||||
cd "$OLDPWD"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_hook() {
|
run_hook() {
|
||||||
|
Loading…
Reference in New Issue
Block a user