Make symlinks relative (fixes #100)
This commit is contained in:
parent
09a018ea5a
commit
6328fac5d2
1 changed files with 15 additions and 1 deletions
16
yadm
16
yadm
|
@ -196,7 +196,7 @@ function alt() {
|
||||||
fi
|
fi
|
||||||
cp -f "$alt_path" "$new_link"
|
cp -f "$alt_path" "$new_link"
|
||||||
else
|
else
|
||||||
ln -nfs "$alt_path" "$new_link"
|
alt_ln "$alt_path" "$new_link"
|
||||||
fi
|
fi
|
||||||
last_linked="$alt_path"
|
last_linked="$alt_path"
|
||||||
fi
|
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() {
|
function bootstrap() {
|
||||||
|
|
||||||
bootstrap_available || error_out "Cannot execute bootstrap\n'$YADM_BOOTSTRAP' is not an executable program."
|
bootstrap_available || error_out "Cannot execute bootstrap\n'$YADM_BOOTSTRAP' is not an executable program."
|
||||||
|
|
Loading…
Reference in a new issue