Evie Litherland-Smith
a52ccf7ef4
Delete some unused (test) scripts Reduce what is sync'd by rsync-local-config: remove fonts, bat config and zellij config
24 lines
793 B
Bash
Executable file
24 lines
793 B
Bash
Executable file
HOSTS=("$@")
|
|
# Config files
|
|
for TARGET in ".inputrc" ".config/starship.toml"; do
|
|
SOURCE="$HOME/$TARGET"
|
|
echo "--- $SOURCE ---"
|
|
TMP_TARGET=/tmp/rsync-local-config
|
|
TMP_SOURCE=$TMP_TARGET
|
|
NIX_SED="sed -i 's|/nix/.*/bin/||g'"
|
|
NIX_REPLACE="$NIX_SED $TMP_TARGET"
|
|
if [[ -e $SOURCE ]]; then
|
|
if [[ -d $SOURCE ]]; then
|
|
SOURCE=$SOURCE/
|
|
TMP_SOURCE=$TMP_SOURCE/
|
|
NIX_REPLACE="fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};"
|
|
fi
|
|
rsync -avzL --exclude=".git*" --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r "$SOURCE" $TMP_TARGET
|
|
sh -c "$NIX_REPLACE"
|
|
for HOST in "${HOSTS[@]}"; do
|
|
rsync -avzL --delete --exclude=".git*" $TMP_SOURCE "$HOST:$TARGET"
|
|
done
|
|
rm -rf $TMP_SOURCE
|
|
fi
|
|
done
|