Add dot-put script

This commit is contained in:
ItsDrike 2024-02-17 22:50:24 +01:00
parent 3c1362f7c9
commit 82ab38ae7f
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
dotdir="$HOME/dots"
dothome="$dotdir/home"
dotroot="$dotdir/root"
syspath="$(realpath "$1")"
if [[ "$syspath" == "$HOME"* ]]; then
dotpath="${syspath/#$HOME/$dothome}"
else
dotpath="$dotroot$syspath"
fi
cp -vi "$syspath" "$dotpath"