diff --git a/.local/bin/scripts/dif b/.local/bin/scripts/dif index 1cad345..62deac9 100755 --- a/.local/bin/scripts/dif +++ b/.local/bin/scripts/dif @@ -16,7 +16,7 @@ if ! test "$command"; then (*sqlite*) sqldiff --summary "${files[@]}" | grep -v '0 changes, 0 inserts, 0 deletes';; # TODO syntax highlighting for INSERT/UPDATE/DELETE (text/*) # Use wiked-diff only for text <10MB - if test 10000000 -gt "$(stat --format=%s *.geojson | paste -s -d'+' | bc)" + if test 10000000 -gt "$(stat --format=%s "${files[@]}" | paste -s -d'+' | bc)" then wiked-diff "${files[@]}" else diff --color=always --unified=1 --report-identical-files "${files[@]}" fi;; diff --git a/.local/bin/scripts/treediff b/.local/bin/scripts/treediff new file mode 100755 index 0000000..8974803 --- /dev/null +++ b/.local/bin/scripts/treediff @@ -0,0 +1,7 @@ +#!/bin/sh -e +# Diff the existing filenames between the given directories +command() { + find "$1" -printf '%P\n' | sort +} +wiked-diff --colored-blocks false <(command "$1") <(command "$2") | + less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen