Skip to content

Instantly share code, notes, and snippets.

@omajid
Last active May 22, 2024 22:34
Show Gist options
  • Save omajid/d4ed94ad4af53ca5e499aadb76dcd684 to your computer and use it in GitHub Desktop.
Save omajid/d4ed94ad4af53ca5e499aadb76dcd684 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
while IFS= read -r -d '' file; do
echo "$file"
jq --sort-keys . "$file" > "$file.normalized"
mv "$file.normalized" "$file"
done < <(find . -type f -iname '*.json' -print0)
while IFS= read -r -d '' file; do
echo "$file"
jq '(.libraries[]).sha512 |= "hash" ' "$file" > "$file.normalized"
mv "$file.normalized" "$file"
done < <(find . -type f -iname '*.deps.json' -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment