fix(jsontools): fix broken conditional in zsh 5.0.2 (#10262)

Fixes #10262
parent b621eee2
...@@ -7,7 +7,7 @@ if [[ -n "$JSONTOOLS_METHOD" ]]; then ...@@ -7,7 +7,7 @@ if [[ -n "$JSONTOOLS_METHOD" ]]; then
fi fi
# If method undefined, find the first one that is installed # If method undefined, find the first one that is installed
if [[ ! -v JSONTOOLS_METHOD ]]; then if [[ -z "$JSONTOOLS_METHOD" ]]; then
for JSONTOOLS_METHOD in node python ruby; do for JSONTOOLS_METHOD in node python ruby; do
# If method found, break out of loop # If method found, break out of loop
(( $+commands[$JSONTOOLS_METHOD] )) && break (( $+commands[$JSONTOOLS_METHOD] )) && break
...@@ -16,7 +16,7 @@ if [[ ! -v JSONTOOLS_METHOD ]]; then ...@@ -16,7 +16,7 @@ if [[ ! -v JSONTOOLS_METHOD ]]; then
done done
# If no methods were found, exit the plugin # If no methods were found, exit the plugin
[[ -v JSONTOOLS_METHOD ]] || return 1 [[ -n "$JSONTOOLS_METHOD" ]] || return 1
fi fi
# Define json tools for each method # Define json tools for each method
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment