From 6ef2f7af353d734fd5d54bb28b49587e2541f221 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 17 Aug 2020 23:24:17 +0100 Subject: [PATCH] updated yaml2json.sh --- yaml2json.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml2json.sh b/yaml2json.sh index 188d9f9c..80accf16 100755 --- a/yaml2json.sh +++ b/yaml2json.sh @@ -34,7 +34,7 @@ usage_args="[]" help_usage "$@" yaml2json(){ - if type -P python &>/dev/null; then + if type -P python &>/dev/null && python -c 'import yaml' &>/dev/null; then python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin, Loader=yaml.FullLoader), sys.stdout, indent=4)' elif type -P ruby &>/dev/null; then # don't want variable expansion