aboutsummaryrefslogtreecommitdiffstats
path: root/pi-ext
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-22 19:42:14 +0200
committeruser <user@clank>2026-08-12 19:34:35 +0200
commit037c96fd7230c389fa40f639e5d546e4d06f54ea (patch)
tree3854cc45ad7c1726ffb6a871821793e3a358e52e /pi-ext
parentAdd install.sh: copy extensions into global pi extensions dir (diff)
downloadsl0ppi-037c96fd7230c389fa40f639e5d546e4d06f54ea.tar.gz
sl0ppi-037c96fd7230c389fa40f639e5d546e4d06f54ea.tar.xz
sl0ppi-037c96fd7230c389fa40f639e5d546e4d06f54ea.zip
install.sh: skip files already identical at destination
Diffstat (limited to 'pi-ext')
-rwxr-xr-xpi-ext/install.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/pi-ext/install.sh b/pi-ext/install.sh
index a93a498..3a6b0e6 100755
--- a/pi-ext/install.sh
+++ b/pi-ext/install.sh
@@ -3,6 +3,7 @@
#
# Copies (does not symlink) every *.ts here into ~/.pi/agent/extensions so the
# global set is a deliberate snapshot, not live-linked to in-progress dev edits.
+# Files already identical at the destination are skipped.
# After installing, use /reload inside a running pi session to pick them up.
#
# Override the target dir with PI_EXT_DIR, e.g:
@@ -33,16 +34,32 @@ if [ "${#files[@]}" -eq 0 ]; then
fi
if [ "$dry_run" -eq 1 ]; then
- echo "Would install ${#files[@]} extension(s) into: $DEST"
- for f in "${files[@]}"; do echo " $f"; done
+ echo "Would sync ${#files[@]} extension(s) into: $DEST"
+ for f in "${files[@]}"; do
+ if cmp -s "$f" "$DEST/$f"; then
+ echo " skip (identical) $f"
+ else
+ echo " copy $f"
+ fi
+ done
exit 0
fi
mkdir -p "$DEST"
+copied=0
for f in "${files[@]}"; do
+ if cmp -s "$f" "$DEST/$f"; then
+ echo "skipped (identical) $f"
+ continue
+ fi
cp "$f" "$DEST/$f"
echo "installed $f -> $DEST/$f"
+ copied=$((copied + 1))
done
echo
-echo "Done. Run /reload in a pi session (or restart pi) to load them."
+if [ "$copied" -eq 0 ]; then
+ echo "Nothing changed; global set already up to date."
+else
+ echo "Done ($copied changed). Run /reload in a pi session (or restart pi) to load them."
+fi