aboutsummaryrefslogtreecommitdiff
path: root/update_from_disk.sh
diff options
context:
space:
mode:
authorMosder <xmosder12@gmail.com>2026-07-18 20:17:13 +0200
committerMosder <xmosder12@gmail.com>2026-07-18 20:17:13 +0200
commit4a9d9ac589f7ef41eb869dffc3d1b499bd8c653c (patch)
tree7948c6131f7af5d5a1731896898bb3d0e641d009 /update_from_disk.sh
parentf3fcc7c9b4e603bede79e77cb05d505d0d83de3d (diff)
made loading and updating scripts more descriptive - now they show only operations that change something
Diffstat (limited to 'update_from_disk.sh')
-rwxr-xr-xupdate_from_disk.sh11
1 files changed, 7 insertions, 4 deletions
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
}