Last active
August 30, 2021 13:16
-
-
Save benibela/6a6ce144c8f1ecbc6ea86e55bb766a62 to your computer and use it in GitHub Desktop.
test if json in a diff has changed or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(:input file: | |
+json := ... | |
-json := ... | |
+json2 := ... | |
-json2 := ... | |
:) | |
xidel patch.diff -e ' | |
let $l := x:lines($raw) | |
let $del := $l[starts-with(., "-") and not(starts-with(., "---"))] | |
let $add := $l[starts-with(., "+") and not(starts-with(., "+++"))] | |
for $i in 1 to count($del) | |
return deep-equal(parse-json(substring-after($del[$i], ":=")), parse-json(substring-after($add[$i], ":=")))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment