Created
May 4, 2023 00:22
-
-
Save C4K3/98a6dd80fbfa4704563da73d460cfb54 to your computer and use it in GitHub Desktop.
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
# Merges the two input files. Execute as | |
# jq -s -f statsmerge.jq file1 file2 | |
# Numeric values with key beginning with "minecraft:" are added together. | |
# For all other values the value in b takes precedence | |
.[0] as $file1 | .[1] as $file2 | | |
$file1 + $file2 | | |
reduce paths(numbers) as $path | |
( | |
.; | |
if ($path | last | startswith("minecraft:")) then | |
setpath($path; getpath($path) + ($file2 | getpath($path))) | |
else | |
. | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment