firmware_tools/autobuild/Common_scripts/differences/json.groovy
Dan Hawkins bd7cff660a Add 'autobuild/Common_scripts/' from commit 'e4f8dab2bb'
git-subtree-dir: autobuild/Common_scripts
git-subtree-mainline: 2354189477
git-subtree-split: e4f8dab2bb
2018-11-30 18:12:06 +00:00

15 lines
414 B
Groovy

def comparefiles(importedjsonfile, currentjsonfile) {
env.IMPORTED_JSON="${importedjsonfile}"
env.CURRENT_JSON="${currentjsonfile}"
if (isUnix()) {
sh """
# jq -S sorts json output
diff -c <(jq -S . "${IMPORTED_JSON}") <(jq -S . "${CURRENT_JSON}")
"""
}
else {
error "Windows not currently supporting json file comparison"
}
}
return this;