1
0
Fork 0
mirror of synced 2024-06-25 16:31:09 -04:00

Make symlinks relative (fixes #100)

This commit is contained in:
Ross Smith II 2018-03-04 07:35:23 -08:00
parent 09a018ea5a
commit 6328fac5d2

16
yadm
View file

@ -196,7 +196,7 @@ function alt() {
fi
cp -f "$alt_path" "$new_link"
else
ln -nfs "$alt_path" "$new_link"
alt_ln "$alt_path" "$new_link"
fi
last_linked="$alt_path"
fi
@ -234,6 +234,20 @@ function alt() {
}
function alt_ln() {
local alt_dir alt_base new_base
alt_dir="$(dirname "$1")"
alt_base="$(basename "$1")"
new_base="$(basename "$2")"
if pushd "$alt_dir" >/dev/null ; then
ln -nfs "$alt_base" "$new_base"
popd &>/dev/null
else
ln -nfs "$1" "$2"
fi
}
function bootstrap() {
bootstrap_available || error_out "Cannot execute bootstrap\n'$YADM_BOOTSTRAP' is not an executable program."