returned func json as json prettifier without syntax highlight

This commit is contained in:
TheK4n 2022-10-08 11:33:38 +03:00
parent b1168ac6fc
commit d93f64e5f4

View File

@ -222,3 +222,12 @@ rayso() {
echo "https://ray.so/?colors=candy&background=true&darkMode=true&padding=64&title=${TITLE}&code=${CODE}&language=auto"
}
# json prettyfier
json() {
if [ -t 0 ]; then # argument
python -m json.tool <<< "$*"
else # pipe
python -m json.tool
fi
}