From b21e0dc13bc98985e6ddd8d5c48207e31ba5362b Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 3 Mar 2024 07:16:01 +0800 Subject: [PATCH] Sync custom folder if not exists --- install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index afee7c15..395ce812 100755 --- a/install.sh +++ b/install.sh @@ -171,14 +171,19 @@ t="$HOME/.config/hypr/hyprland.conf" if [ -f $t ];then echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" v cp -f .config/hypr/hyprland.conf $t.new - if [ ! -d "$HOME"/.config/hypr/custom ];then - 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 +fi else echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" v cp .config/hypr/hyprland.conf $t 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,