diff --git a/antigen.zsh b/antigen.zsh index aa32ff2..30ec66f 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -245,12 +245,12 @@ antigen-revert () { # If we have a `*.plugin.zsh`, source it. source "$script_loc" - elif [[ ! -z "$(ls "$location" | grep -m1 '\.zsh$')" ]]; then + elif ls "$location" | grep -qm1 '\.zsh$'; then # If there is no `*.plugin.zsh` file, source *all* the `*.zsh` # files. for script ($location/*.zsh(N)) source "$script" - elif [[ ! -z "$(ls "$location" | grep -m1 '\.sh$')" ]]; then + elif ls "$location" | grep -qm1 '\.sh$'; then # If there are no `*.zsh` files either, we look for and source any # `*.sh` files instead. for script ($location/*.sh(N)) source "$script"