From 3319021d959a09a636ea247f1d42774b4e1d389b Mon Sep 17 00:00:00 2001 From: H0mire Date: Wed, 22 May 2024 21:23:45 +0200 Subject: [PATCH] bugfixes --- update-dots.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-dots.sh b/update-dots.sh index 90258b59..8b4408a0 100644 --- a/update-dots.sh +++ b/update-dots.sh @@ -72,7 +72,7 @@ if [[ $(git rev-list HEAD...origin/"$current_branch" --count) -eq 0 ]]; then echo -e "${GREEN}Repository is already up-to-date. Do not run git pull before this script. Exiting...${RESET}" exit 0 fi -echo -e "${CYAN}Excluding files and folders that remain untouched: ${excludes[@]}${RESET}" +echo -e "${CYAN}Excluding files and folders that remain untouched:${RESET} ${excludes[@]}" # Then check which files have been customized by the user since the last update to preserve user configurations modified_files=() @@ -222,15 +222,15 @@ renamed_files=$(git diff --name-status @{1} | awk '$1 ~ /^R/ {print $2, "->", $3 files_to_remove=() -for file in $files_to_remove; do +for file in $deleted_files; do if ! file_in_excludes "$file" && [[ ! " ${modified_files[*]} " =~ " $file " ]]; then files_to_remove+=("$file") fi done -for file in $files_renamed; do +for file in $renamed_files; do if ! file_in_excludes "$file" && [[ ! " ${modified_files[*]} " =~ " $file " ]]; then - files_renamed+=("$file") + files_to_remove+=("$file") fi done