Handle missing jq command

This commit is contained in:
Dan Hawkins 2019-01-21 15:15:27 +00:00
commit 42df36426c

View file

@ -3,6 +3,8 @@ def comparefiles(importedjsonfile, currentjsonfile) {
env.CURRENT_JSON="${currentjsonfile}"
if (isUnix()) {
sh """
which jq
if [ \$? -ne 0 ]; then exit 1; fi
# jq -S sorts json output
diff -c <(jq -S . "${IMPORTED_JSON}") <(jq -S . "${CURRENT_JSON}")
"""