firmware_tools/differences/json.groovy
2019-02-13 18:20:05 +00:00

15 lines
401 B
Groovy

def comparefiles(importedjsonfile, currentjsonfile) {
if (isUnix()) {
sh """
which jq
if [ \$? -ne 0 ]; then exit 1; fi
# jq -S sorts json output
diff -c <(jq -S . "${importedjsonfile}") <(jq -S . "${currentjsonfile}")
"""
}
else {
error "Windows not currently supporting json file comparison"
}
}
return this;