From 74459a9818b13101f5ef2e1fb2db0df760156189 Mon Sep 17 00:00:00 2001 From: Frank Gruellich Date: Thu, 16 Nov 2017 09:02:05 +0100 Subject: [PATCH] Detect aws cli completion file from RPM (#6424). --- plugins/aws/aws.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 6a0e04ad..81ad7fda 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -21,6 +21,10 @@ _awscli-homebrew-installed() { [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null } +_awscli-rpm-installed() { + which rpm &>/dev/null && rpm -q --quiet awscli +} + export AWS_HOME=~/.aws function agp { @@ -44,9 +48,11 @@ compctl -K aws_profiles asp if _homebrew-installed && _awscli-homebrew-installed ; then _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh +elif _awscli-rpm-installed; then + _aws_zsh_completer_path="/usr/share/zsh/site-functions/aws_zsh_completer.sh" else _aws_zsh_completer_path=$(which aws_zsh_completer.sh) fi -[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path +[ -r $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path unset _aws_zsh_completer_path