File: json-diff-pretty.sh

package info (click to toggle)
nftables 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,384 kB
  • sloc: ansic: 50,901; sh: 20,277; yacc: 5,861; python: 1,746; lex: 1,367; makefile: 392
file content (17 lines) | stat: -rwxr-xr-x 332 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash -e

BASEDIR="$(dirname "$0")"

[ $# -eq 2 ] || (echo "$0: expects two JSON files as arguments" ; exit 1)

FILE1="$1"
FILE2="$2"

pretty()
{
	"$BASEDIR/json-pretty.sh" < "$1" 2>&1 || :
}

echo "Cmd: \"$0\" \"$FILE1\" \"$FILE2\""
diff -u "$FILE1" "$FILE2" 2>&1 || :
diff -u <(pretty "$FILE1") <(pretty "$FILE2") 2>&1 || :