Merge commit '06c096fc7c'
This commit is contained in:
commit
fec03bc34d
2 changed files with 17 additions and 3 deletions
16
differences/file.groovy
Normal file
16
differences/file.groovy
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
def comparefiles(importedfile, currentfile, boolean ignorewhitespace = true) {
|
||||||
|
if (isUnix()) {
|
||||||
|
def wsparameter = "-w"
|
||||||
|
if (!ignorewhitespace) {
|
||||||
|
wsparameter = ""
|
||||||
|
}
|
||||||
|
sh """
|
||||||
|
diff -c ${wsparameter} "${importedfile}" "${currentfile}"
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
error "Windows not currently supporting file comparison"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
def comparefiles(importedjsonfile, currentjsonfile) {
|
def comparefiles(importedjsonfile, currentjsonfile) {
|
||||||
env.IMPORTED_JSON="${importedjsonfile}"
|
|
||||||
env.CURRENT_JSON="${currentjsonfile}"
|
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh """
|
sh """
|
||||||
which jq
|
which jq
|
||||||
if [ \$? -ne 0 ]; then exit 1; fi
|
if [ \$? -ne 0 ]; then exit 1; fi
|
||||||
# jq -S sorts json output
|
# jq -S sorts json output
|
||||||
diff -c <(jq -S . "${IMPORTED_JSON}") <(jq -S . "${CURRENT_JSON}")
|
diff -c <(jq -S . "${importedjsonfile}") <(jq -S . "${currentjsonfile}")
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue