mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
vfs: fixed test for symlinks
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
2f6485a32e
commit
77c7079784
1 changed files with 5 additions and 4 deletions
9
bin/vfs
9
bin/vfs
|
|
@ -21,10 +21,11 @@ function vfs.path name {
|
||||||
|
|
||||||
function vfs.path.real file {
|
function vfs.path.real file {
|
||||||
for root in "${CURRENT_SOURCES[@]}" ; do
|
for root in "${CURRENT_SOURCES[@]}" ; do
|
||||||
if [ -e "$root/$file" ] {
|
nux.log trace "Testing $root$file"
|
||||||
echo $root/$file;
|
if [ -e "${root}${file}" -o -h "${root}${file}" ]; then
|
||||||
|
echo ${root}${file};
|
||||||
return 0;
|
return 0;
|
||||||
}
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,7 +58,7 @@ function vfs.path.real file {
|
||||||
target="$(vfs.path "$storage")"
|
target="$(vfs.path "$storage")"
|
||||||
nux.log debug "Target path $target"
|
nux.log debug "Target path $target"
|
||||||
for arg_path in "$@" ; do
|
for arg_path in "$@" ; do
|
||||||
rooted_path="/$(realpath -m --relative-to="$CURRENT_MOUNT" ${arg_path%/})";
|
rooted_path="/$(realpath -Lms --relative-to="$CURRENT_MOUNT" ${arg_path%/})";
|
||||||
target_dir="${target}${rooted_path%/*}"
|
target_dir="${target}${rooted_path%/*}"
|
||||||
real_file="$(vfs.path.real "$rooted_path")"
|
real_file="$(vfs.path.real "$rooted_path")"
|
||||||
nux.log trace "Rooted path: $rooted_path";
|
nux.log trace "Rooted path: $rooted_path";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue