This commit is contained in:
Dan Hawkins 2018-10-24 11:23:53 +01:00
commit e327d52b3f

15
differences/json.gsh Normal file
View file

@ -0,0 +1,15 @@
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;