Last active
February 19, 2019 14:19
-
-
Save hellwolf/8e1c2097d3d4529afac3151ed0cd9c8a to your computer and use it in GitHub Desktop.
jq sort truffle contract json artifact
This file contains hidden or 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
jq -r '[ | |
. as $root | keys[] as $k | $root[$k] | @json | length as $len | { key: $k, length: $len } | |
] | sort_by(.length) | reverse | map("\(.key) \(.length)")[]' $CONTRACT_JSON_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment