From d202c89bfa3fc0e2ce83bf65cd7e0872246c53eb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 24 Oct 2018 10:07:49 +0100 Subject: [PATCH] Move json file comparison to subtree area --- differences/json.gsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 differences/json.gsh diff --git a/differences/json.gsh b/differences/json.gsh new file mode 100644 index 0000000..47d9cc5 --- /dev/null +++ b/differences/json.gsh @@ -0,0 +1,15 @@ +def comparefiles(importedjsonfile, currentjsonfile) { + env.IMPORTED_JSON="${importedjsonfile}" + env.CURRENT_JSON="${currentjsonfile}" + if (isUnix()) { + sh """ + # jq -S sorts json output + diff -c <(jq -S . "${IMPORTED_JSON}") <(jq -S . "${CURRENT_JSON}") + """ + } + else { + error "Windows not currently supporting json file comparison" + } +} + +return this;