mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-25 04:34:35 +00:00
Add dot-put script
This commit is contained in:
parent
3c1362f7c9
commit
82ab38ae7f
15
home/.local/bin/scripts/cli/dot-put
Executable file
15
home/.local/bin/scripts/cli/dot-put
Executable 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"
|
Loading…
Reference in a new issue