6d5d67a35dcc8262dec72cd610ebfef355986f41
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #3067 from tacgnol/AWS
Fix issue with homebrew installed awscli
Diff
1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
2index 3f7fb199581c399916ceae46ff60ef3c3edd7485..8b57d7db1ca36fb62bf8f53b090a67c62939ed03 100644
3--- a/plugins/aws/aws.plugin.zsh
4+++ b/plugins/aws/aws.plugin.zsh
5@@ -1,3 +1,11 @@
6+_homebrew-installed() {
7+ type brew &> /dev/null
8+}
9+
10+_awscli-homebrew-installed() {
11+ brew --prefix awscli &> /dev/null
12+}
13+
14 export AWS_HOME=~/.aws
15
16 function agp {
17@@ -14,4 +22,9 @@ function aws_profiles {
18 }
19
20 compctl -K aws_profiles asp
21-source `which aws_zsh_completer.sh`
22+
23+if _homebrew-installed && _awscli-homebrew-installed ; then
24+ source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
25+else
26+ source `which aws_zsh_completer.sh`
27+fi