vim-settings/scripts/sort-json.sh

8 lines
130 B
Bash
Raw Normal View History

2022-03-01 00:31:56 +00:00
#! /usr/bin/env bash
set -e
for f in "$@"; do
jq --sort-keys --monochrome-output . "$f" > "$f.tmp"
mv "$f.tmp" "$f"
done