Browse Source

chg: [rsync-backup-target] use color when outputing diff when available

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
backup
Valentin Lab 4 years ago
parent
commit
ff87489be8
  1. 5
      rsync-backup-target/resources/bin/compose-add-rsync-key

5
rsync-backup-target/resources/bin/compose-add-rsync-key

@ -125,8 +125,11 @@ EOF
exit 1 exit 1
fi fi
echo "${WHITE}Applying these changes:${NORMAL}" echo "${WHITE}Applying these changes:${NORMAL}"
if type -p colordiff >/dev/null; then
colordiff -u "$compose_file" <(echo "$content")
else
echo "$diff" echo "$diff"
fi | egrep -v "^[^ ]*(---|\+\+\+)"
cp "$compose_file" "${compose_file}.old" cp "$compose_file" "${compose_file}.old"
echo "$content" > "$compose_file" echo "$content" > "$compose_file"

Loading…
Cancel
Save