AHBKM1024A-88 - Compare json files in windows
This commit is contained in:
parent
1057c1a7bf
commit
e8e5a862c0
1 changed files with 12 additions and 5 deletions
|
|
@ -1,15 +1,22 @@
|
|||
def comparefiles(importedfile, currentfile, boolean ignorewhitespace = true) {
|
||||
def wsparameter = "-w"
|
||||
if (!ignorewhitespace) {
|
||||
wsparameter = ""
|
||||
}
|
||||
if (isUnix()) {
|
||||
def wsparameter = "-w"
|
||||
if (!ignorewhitespace) {
|
||||
wsparameter = ""
|
||||
}
|
||||
sh """
|
||||
diff -c ${wsparameter} "${importedfile}" "${currentfile}"
|
||||
"""
|
||||
}
|
||||
else {
|
||||
error "Windows not currently supporting file comparison"
|
||||
// diffutils can be installed on windows with chocolatey
|
||||
bat """
|
||||
REM echo Checking utilities exist
|
||||
where diff
|
||||
if errorlevel 1 EXIT /b 1
|
||||
|
||||
diff -c ${wsparameter} "${importedfile}" "${currentfile}"
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue