You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
341 B
Bash
15 lines
341 B
Bash
require assert/command
|
|
|
|
assert_command bat dasel
|
|
|
|
json_to_yaml() (
|
|
ARG=${1-}
|
|
if [ -z "${ARG}" ]; then
|
|
dasel --read json --write yaml | bat --language yaml
|
|
elif [ -f "${ARG}" ]; then
|
|
dasel --read json --write yaml --file "${ARG}" | bat --language yaml
|
|
else
|
|
echo "${ARG}" | dasel --read json --write yaml | bat --language yaml
|
|
fi
|
|
)
|