firmware_tools/Common_scripts/differences/file.groovy

23 lines
606 B
Groovy

def comparefiles(importedfile, currentfile, boolean ignorewhitespace = true) {
def wsparameter = "-w"
if (!ignorewhitespace) {
wsparameter = ""
}
if (isUnix()) {
sh """
diff -c ${wsparameter} "${importedfile}" "${currentfile}"
"""
}
else {
// diffutils can be installed on windows with chocolatey
powershell """
# echo Checking utilities exist
# where diff
# if errorlevel 1 EXIT /b 1
diff.exe -c ${wsparameter} "${importedfile}" "${currentfile}"
"""
}
}
return this;