apple-intelligence-prompts/scripts/format.sh
Explosion Implosion aaa2675dfc Format files
2024-08-09 19:56:03 -05:00

16 lines
264 B
Bash
Executable File

#!/usr/bin/env bash
jqb () {
temp=$(mktemp)
printf 'input = %s\n' "$1"
printf 'temp = %s\n' "$temp"
cp -- "$1" "$temp"
jq . "$temp" > "$1"
rm "$temp"
}
find . -type f -name "*.json" -print0 | \
while IFS= read -r -d '' file; do
jqb "$file"
done