fix: env.sh uses rsync for faster syncs for my dotfiles
This commit is contained in:
@@ -15,7 +15,7 @@ set -s escape-time 0
|
|||||||
|
|
||||||
bind -r f run-shell "tmux neww ~/.local/bin/tmux-windowizer"
|
bind -r f run-shell "tmux neww ~/.local/bin/tmux-windowizer"
|
||||||
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
||||||
bind -r z run-shell "tmux kill-session"
|
bind -r q run-shell "tmux kill-session"
|
||||||
|
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ ORIGINAL_DOTS=(
|
|||||||
"${DOTFILES_LOCAL}bin/"
|
"${DOTFILES_LOCAL}bin/"
|
||||||
"${DOTFILES_LOCAL}share/fonts/"
|
"${DOTFILES_LOCAL}share/fonts/"
|
||||||
"${DOTFILES_HOME}.xinitrc"
|
"${DOTFILES_HOME}.xinitrc"
|
||||||
"${DOTFILES_HOME}.bashrc")
|
"${DOTFILES_HOME}.bashrc"
|
||||||
|
)
|
||||||
COPY_DOTS=(
|
COPY_DOTS=(
|
||||||
"${CONFIG}suckless/"
|
"${CONFIG}suckless/"
|
||||||
"${CONFIG}nvim/"
|
"${CONFIG}nvim/"
|
||||||
@@ -29,33 +30,22 @@ COPY_DOTS=(
|
|||||||
"${LOCAL}bin/"
|
"${LOCAL}bin/"
|
||||||
"${LOCAL}share/fonts/"
|
"${LOCAL}share/fonts/"
|
||||||
"${PERSONAL_HOME}.xinitrc"
|
"${PERSONAL_HOME}.xinitrc"
|
||||||
"${PERSONAL_HOME}.bashrc")
|
"${PERSONAL_HOME}.bashrc"
|
||||||
|
)
|
||||||
for x in "${!COPY_DOTS[@]}"; do
|
|
||||||
i="${COPY_DOTS[${x}]}"
|
|
||||||
if [[ -d ${i} ]]; then
|
|
||||||
echo -e "${i} ${GREEN}exists: Removing${RESET}"
|
|
||||||
doas rm -rd "${i}"
|
|
||||||
elif [[ -f ${i} ]]; then
|
|
||||||
echo -e "${i} ${GREEN}exists: Removing${RESET}"
|
|
||||||
doas rm -rf "${i}"
|
|
||||||
else
|
|
||||||
echo -e "${i} ${YELLOW}does not exist: Skipping${RESET}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for x in "${!ORIGINAL_DOTS[@]}"; do
|
for x in "${!ORIGINAL_DOTS[@]}"; do
|
||||||
i="${ORIGINAL_DOTS[${x}]}"
|
src="${ORIGINAL_DOTS[$x]}"
|
||||||
if [[ -d ${i} ]]; then
|
dst="${COPY_DOTS[$x]}"
|
||||||
echo "Directory: ${i} -> ${COPY_DOTS[${x}]}"
|
|
||||||
cp -r ${i} ${COPY_DOTS[${x}]}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f ${i} ]]; then
|
if [[ -d "$src" ]]; then
|
||||||
echo "File: ${i} -> ${COPY_DOTS[${x}]}"
|
echo -e "Syncing directory: ${GREEN}${src}${RESET} -> ${YELLOW}${dst}${RESET}"
|
||||||
cp ${i} ${COPY_DOTS[${x}]}
|
rsync -avh --delete "$src" "$dst"
|
||||||
|
elif [[ -f "$src" ]]; then
|
||||||
|
echo -e "Syncing file: ${GREEN}${src}${RESET} -> ${YELLOW}${dst}${RESET}"
|
||||||
|
rsync -avh "$src" "$dst"
|
||||||
|
else
|
||||||
|
echo -e "${RED}Missing: ${src}${RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "${GREEN}Rebuilding Suckless Software${RESET}"
|
echo -e "${GREEN}Rebuilding Suckless Software${RESET}"
|
||||||
|
|||||||
Reference in New Issue
Block a user