1
0
mirror of https://github.com/zplug/zplug synced 2025-04-30 13:17:57 +02:00

use jq if available for JSON quoting

This commit is contained in:
Christian Höltje 2020-10-26 18:02:17 -04:00
parent c4dea76656
commit b2a6c720da

@ -257,7 +257,9 @@ __zplug::utils::shell::eval()
__zplug::utils::shell::json_escape()
{
if (( $+commands[python] )) && python -c 'import json' 2> /dev/null; then
if (( $+commands[jq] )); then
jq --ascii-output --raw-input --slurp .
elif (( $+commands[python] )) && python -c 'import json' 2> /dev/null; then
python -c '
from __future__ import print_function
import json,sys