Fix dot-put script

This commit is contained in:
ItsDrike 2024-02-18 20:32:00 +01:00
parent 0d3c5f1db4
commit a1f9a7c82d
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -2,8 +2,9 @@
set -euo pipefail
dotdir="$HOME/dots"
dothome="$dotdir/home"
dotroot="$dotdir/root"
# the trailing slashes are important here!
dothome="$dotdir/home/"
dotroot="$dotdir/root/"
usage() {
echo "$0"
@ -21,7 +22,7 @@ Details:
}
dotcopy() {
syspath="$1"
syspath="$(realpath "$1")"
if [[ "$syspath" == "$HOME"* ]]; then
dotpath="${syspath/#$HOME/$dothome}"