Move json file comparison to subtree area
This commit is contained in:
parent
1d9684363a
commit
d202c89bfa
1 changed files with 15 additions and 0 deletions
15
differences/json.gsh
Normal file
15
differences/json.gsh
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue