e363109a6d3367d8be1dd66f05a38eb38b4257d7

Author
Vice Versa <0x7c48@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

alias-finder: fix wc numeric conditional (#8251)

Never use `[[` for numeric comparisons, for that, we’ll use `((`.

Diff

 1diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh
 2index 2bfaad597e26e4f1dd0d95eb745887c45844fd6e..6b8fa66ce4290e8f40dbbf76edd5f2e6f13be405 100644
 3--- a/plugins/alias-finder/alias-finder.plugin.zsh
 4+++ b/plugins/alias-finder/alias-finder.plugin.zsh
 5@@ -14,7 +14,7 @@ alias-finder() {
 6     esac
 7   done
 8   cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep
 9-  if [[ $(wc -l <<< $cmd) == 1 ]]; then
10+  if (( $(wc -l <<< $cmd) == 1 )); then
11     while [[ $cmd != "" ]]; do
12       if [[ $longer = true ]]; then
13         wordStart="'{0,1}"