fix(jsontools): fix broken conditional in zsh 5.0.2 (#10262)
Fixes #10262
Diff
1diff --git a/plugins/jsontools/jsontools.plugin.zsh b/plugins/jsontools/jsontools.plugin.zsh
2index ed45cfa8ebcd10389878c5a8355a44b6cf60b24f..857ca0ec9946a061c3c4f5fe9a94b03ea3223e32 100644
3--- a/plugins/jsontools/jsontools.plugin.zsh
4+++ b/plugins/jsontools/jsontools.plugin.zsh
5@@ -7,7 +7,7 @@ if [[ -n "$JSONTOOLS_METHOD" ]]; then
6 fi
7 8 # If method undefined, find the first one that is installed
9-if [[ ! -v JSONTOOLS_METHOD ]]; then
10+if [[ -z "$JSONTOOLS_METHOD" ]]; then
11 for JSONTOOLS_METHOD in node python ruby; do
12 # If method found, break out of loop
13 (( $+commands[$JSONTOOLS_METHOD] )) && break
14@@ -16,7 +16,7 @@ if [[ ! -v JSONTOOLS_METHOD ]]; then
15 done
1617 # If no methods were found, exit the plugin
18- [[ -v JSONTOOLS_METHOD ]] || return 1
19+ [[ -n "$JSONTOOLS_METHOD" ]] || return 1
20 fi
2122 # Define json tools for each method