Compare hps_0.h files

This commit is contained in:
Dan Hawkins 2019-02-13 18:20:05 +00:00
commit 3264655356
2 changed files with 13 additions and 3 deletions

12
differences/file.groovy Normal file
View file

@ -0,0 +1,12 @@
def comparefiles(importedfile, currentfile) {
if (isUnix()) {
sh """
diff -c <"${importedfile}" <"${currentfile}"
"""
}
else {
error "Windows not currently supporting file comparison"
}
}
return this;

View file

@ -1,12 +1,10 @@
def comparefiles(importedjsonfile, currentjsonfile) {
env.IMPORTED_JSON="${importedjsonfile}"
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}")
diff -c <(jq -S . "${importedjsonfile}") <(jq -S . "${currentjsonfile}")
"""
}
else {