From 4a9d9ac589f7ef41eb869dffc3d1b499bd8c653c Mon Sep 17 00:00:00 2001 From: Mosder Date: Sat, 18 Jul 2026 20:17:13 +0200 Subject: made loading and updating scripts more descriptive - now they show only operations that change something --- update_from_disk.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'update_from_disk.sh') diff --git a/update_from_disk.sh b/update_from_disk.sh index c0e9d55..b113e31 100755 --- a/update_from_disk.sh +++ b/update_from_disk.sh @@ -15,10 +15,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" copy_file() { local src="$1" local dest="$2" - echo "cp -a $src $dest" - if ! cp -a "$src" "$dest" 2>/dev/null; then - echo "Failed - using sudo..." - sudo cp -a "$src" "$dest" + # update only if files are different + if ! diff "$src" "$dest" &>/dev/null; then + echo "Updating $dest..." + if ! cp -a "$src" "$dest" 2>/dev/null; then + echo "Failed - using sudo..." + sudo cp -a "$src" "$dest" + fi fi } -- cgit v1.2.3