From e7481324994deb45ec38b054416adcff2083b5b7 Mon Sep 17 00:00:00 2001 From: H0mire Date: Sat, 4 May 2024 11:10:00 +0200 Subject: [PATCH] made so it checks if repo is already up to date since, no checksum cache is implemented yet --- update-dots.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/update-dots.sh b/update-dots.sh index e12d65ac0..3a4218ea8 100644 --- a/update-dots.sh +++ b/update-dots.sh @@ -26,6 +26,19 @@ function file_in_excludes() { return 1 } + +# fetch the latest version of the repository +if ! git fetch; then + echo "Failed to fetch the latest version of the repository. Exiting." + exit 1 +fi + +# Check if there are any changes +if [[ $(git rev-list HEAD...origin/main --count) -eq 0 ]]; then + echo "No changes found. Exiting." + exit 0 +fi + # Then check which files have been modified by the user since the last update to preserve user configurations modified_files=()