summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Tahvildaran <amir@bizequity.com>2020-07-18 13:06:08 -0400
committerGitHub <noreply@github.com>2020-07-18 19:06:08 +0200
commitdb3d05fe7184a523fe4aba120bea962114424573 (patch)
tree95ff96c3ce846d60c0803ac507b93a4a42c1b622
parenta3740c34148a7a44d82683d2aa31c98f32b21a96 (diff)
downloadzsh-db3d05fe7184a523fe4aba120bea962114424573.tar.gz
zsh-db3d05fe7184a523fe4aba120bea962114424573.tar.bz2
zsh-db3d05fe7184a523fe4aba120bea962114424573.zip
aws: improve check for aws_completer - unhardcode path (#9123)
Closes #9122 The current check is assuming that the aws_completer is installed globally, it then runs the command without that path I have aws_completer in ~/.local/bin/aws_completer This changes the check to see if the command exists instead of concerning itself with where it in installed. This test matches the behavior of just running the command.
-rw-r--r--plugins/aws/aws.plugin.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index d00c2e56c..7994963c3 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -63,7 +63,7 @@ fi
# Load awscli completions
# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back
-if [[ -x /usr/local/bin/aws_completer ]]; then
+if command -v aws_completer &> /dev/null; then
autoload -Uz bashcompinit && bashcompinit
complete -C aws_completer aws
else