1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2025-06-13 13:03:58 +00:00

Merge branch 'rasa-relative-symlinks'

This commit is contained in:
Ross Smith II 2018-03-04 07:39:10 -08:00
commit 6ae3ef1d03

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."