From 7a71ab38f431fe0f9cdf206a9bcdc0c8c560a3b5 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 29 Feb 2024 00:51:42 -0500 Subject: [PATCH] fix: ensure that diffing is done in the right direction --- bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 4780841..e0bd8fd 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -59,7 +59,7 @@ copy_file() { return 0 fi - difference=$(diff "$source_path" "$dest_path") + difference=$(diff "$dest_path" "$source_path") if [ -z "$difference" ]; then echo "$dest_path already exists, but is the same as $source_path - skipping." @@ -67,7 +67,7 @@ copy_file() { fi echo "Differences detected between $source_path and $dest_path:" - diff --color "$source_path" "$dest_path" + diff --color "$dest_path" "$source_path" read -p "$dest_path already exists. What should be done? [O:overwrite,S:skip,B:save backup and copy] " -r action if [[ $action == "O" ]]; then