Last active
May 31, 2019 08:15
-
-
Save aras-p/4067c7677f48086743607ea2835b6a79 to your computer and use it in GitHub Desktop.
Using jq to manipulate build DAG json
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
cat artifacts/tundra/${1}.dag1.json | ./jq-osx-amd64 ".Nodes[] | {ann: .Annotation, act: (try .Action catch \"\"|split(\" \")|unique), txt: (try .WriteTextFilePayload catch \"foo\"|split(\" \")|map(split(\",\")|map(split(\"\\n\")))|add|add|unique), inp:.Inputs|unique}" >artifacts/_/${1}.dag1.json | |
cat artifacts/tundra/${1}.dag.json | ./jq-osx-amd64 ".Nodes[] | {ann: .Annotation, act: (try .Action catch \"\"|split(\" \")|unique), txt: (try .WriteTextFilePayload catch \"foo\"|split(\" \")|map(split(\",\")|map(split(\"\\n\")))|add|add|unique), inp:.Inputs|unique}" >artifacts/_/${1}.dag.json | |
diff -Naur artifacts/_/${1}.dag1.json artifacts/_/${1}.dag.json >artifacts/_/_${1}.diff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment