localpath
This commit is contained in:
parent
3761493c7c
commit
2bd752012c
17
urchin
17
urchin
@ -249,14 +249,15 @@ localpath() {
|
|||||||
child="$(fullpath "${2}" | sed 's/\/*$//')"
|
child="$(fullpath "${2}" | sed 's/\/*$//')"
|
||||||
|
|
||||||
if test "${parent}" = "${child}"; then
|
if test "${parent}" = "${child}"; then
|
||||||
echo .
|
# Same file
|
||||||
else
|
|
||||||
rel="${child##"${parent}/"}"
|
|
||||||
if test "${rel}" = "${parent}"; then
|
|
||||||
return 1
|
return 1
|
||||||
|
elif contains "${child}" "^${parent}";
|
||||||
|
# Child is really a child.
|
||||||
|
echo "${child##"${parent}/"}"
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
echo "${rel}"
|
# Child is not really a child.
|
||||||
fi
|
return 2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,10 +276,6 @@ is_set() {
|
|||||||
set | grep "^${1}=" > /dev/null
|
set | grep "^${1}=" > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_trailing_slash() {
|
|
||||||
echo "$1" | sed s/\\/$//
|
|
||||||
}
|
|
||||||
|
|
||||||
# File where a test's stdout and stderr is saved
|
# File where a test's stdout and stderr is saved
|
||||||
stdout_file() {
|
stdout_file() {
|
||||||
tmp_dir="${1}"
|
tmp_dir="${1}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user