AHBKM1024A-88 - Compare json files in windows

This commit is contained in:
Dan Hawkins 2021-04-07 17:56:11 +01:00
commit e8e5a862c0

View file

@ -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}"
"""
}
}