Sync custom folder if not exists

This commit is contained in:
clsty 2024-03-03 07:16:01 +08:00
parent 1557df5e24
commit b21e0dc13b

View file

@ -171,14 +171,19 @@ t="$HOME/.config/hypr/hyprland.conf"
if [ -f $t ];then if [ -f $t ];then
echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m"
v cp -f .config/hypr/hyprland.conf $t.new v cp -f .config/hypr/hyprland.conf $t.new
if [ ! -d "$HOME"/.config/hypr/custom ];then fi
echo -e "\e[33m[$0]: But it seems that you are not using a \"custom\" folder.\e[0m"
v cp .config/hypr/hyprland.conf $t
fi
else else
echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m"
v cp .config/hypr/hyprland.conf $t v cp .config/hypr/hyprland.conf $t
fi fi
t="$HOME/.config/hypr/custom"
if [ -d $t ];then
echo -e "\e[34m[$0]: \"$t\" already exists, will not do anything.\e[0m"
fi
else
echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m"
v rsync -av --delete .config/hypr/custom/ $t/
fi
# some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync, # some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync,