returned func json as json prettifier without syntax highlight
This commit is contained in:
parent
b1168ac6fc
commit
d93f64e5f4
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user