dotfiles/.local/bin/scripts/cj

6 lines
238 B
Bash
Executable File

#!/bin/sh
# [c]at the given files as prettified [j]son
# add echo in case file is missing newline at the end
{ cat "$@"; echo; } | while read -r line; do echo -n "$line" | python3 -m json.tool; done | bat --language json --style numbers