From 564ed643ca64e67f104c0b2dd86d7489f1fd183c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 1 Jul 2021 00:07:24 +0100 Subject: [PATCH] Convert bat to powershell; Remove debug --- differences/json.groovy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/differences/json.groovy b/differences/json.groovy index 7e9b7c3..1b95c7b 100644 --- a/differences/json.groovy +++ b/differences/json.groovy @@ -37,14 +37,17 @@ def comparefiles(importedjsonfile, currentjsonfile) { if (\$lastexitcode -ge 1) { exit 1 } # echo Diffing sorted json files - diff -c temp1.txt temp2.txt - \$el = \$lastexitcode + $str1 = Get-Content "temp1.txt" + $str2 = Get-Content "temp2.txt" + $diff = Compare-Object $str1 $str2 + if ($diff -ne '') { + echo "Difference between JSON files:" + echo $diff + exit 1 + } Remove-Item temp1.txt Remove-Item temp2.txt - - # echo Diffing result: \$el - if (\$el -ge 1) { exit 1 } """ } }