From f49220732904ed254400f14e621ea5ebe9e4a5f5 Mon Sep 17 00:00:00 2001 From: "Douglas S.D. Hall" Date: Sat, 30 Aug 2014 17:20:28 +0100 Subject: Amended to source the original aws_zsh_completer.sh rather than the mangled version installed into $(brew-prefix)/bin if using homebrew installed awscli on OSX. This was discussed here - https://github.com/Homebrew/homebrew/issues/30268 --- plugins/aws/aws.plugin.zsh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'plugins/aws') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 3f7fb1995..8b57d7db1 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,3 +1,11 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_awscli-homebrew-installed() { + brew --prefix awscli &> /dev/null +} + export AWS_HOME=~/.aws function agp { @@ -14,4 +22,9 @@ function aws_profiles { } compctl -K aws_profiles asp -source `which aws_zsh_completer.sh` + +if _homebrew-installed && _awscli-homebrew-installed ; then + source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh +else + source `which aws_zsh_completer.sh` +fi -- cgit v1.2.3-70-g09d2 From 87fb118dd252d7e9b658c66c51b5e3cb905f10fb Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Wed, 3 Sep 2014 12:01:29 -0700 Subject: Changed brew cmd to properly report if awscli is installed via homebrew --- plugins/aws/aws.plugin.zsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins/aws') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 8b57d7db1..de786725f 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -3,19 +3,17 @@ _homebrew-installed() { } _awscli-homebrew-installed() { - brew --prefix awscli &> /dev/null + brew list awscli &> /dev/null } export AWS_HOME=~/.aws function agp { echo $AWS_DEFAULT_PROFILE - } function asp { export AWS_DEFAULT_PROFILE=$1 - export RPROMPT="" - + export RPROMPT="" } function aws_profiles { reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) -- cgit v1.2.3-70-g09d2 From 7931d5ce1a72cc49cc64478042bc3ef3b667ac8e Mon Sep 17 00:00:00 2001 From: Superbil Date: Tue, 16 Dec 2014 00:17:58 +0800 Subject: Fix aws.plugins.zsh check rule Check _aws_zsh_completer_path had exist or not --- plugins/aws/aws.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/aws') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index de786725f..0ae18dd56 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -22,7 +22,10 @@ function aws_profiles { compctl -K aws_profiles asp if _homebrew-installed && _awscli-homebrew-installed ; then - source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh + _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh else - source `which aws_zsh_completer.sh` + _aws_zsh_completer_path=$(which aws_zsh_completer.sh) fi + +[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path +unset _aws_zsh_completer_path -- cgit v1.2.3-70-g09d2 From 5770ad51f963af7b75af03fabc691492137277ef Mon Sep 17 00:00:00 2001 From: Werner Buck Date: Tue, 9 Jun 2015 16:52:40 +0200 Subject: Set AWS_PROFILE and use existing RPROMPT --- plugins/aws/aws.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/aws') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 0ae18dd56..6d93d530d 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -13,7 +13,8 @@ function agp { } function asp { export AWS_DEFAULT_PROFILE=$1 - export RPROMPT="" + export AWS_PROFILE=$1 + export RPROMPT="$RPROMPT" } function aws_profiles { reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) -- cgit v1.2.3-70-g09d2 From 41104f8af842cd9ba441255808053a36ef4fcd6b Mon Sep 17 00:00:00 2001 From: Andrew Purcell Date: Mon, 1 Dec 2014 12:29:59 -0800 Subject: Fix homebrew directory in aws plugin. Sometimes the output of ``homebrew --prefix`` and ``homebrew --prefix awscli`` don't match, and the second is the correct call. --- plugins/aws/aws.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/aws') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 0ae18dd56..e5e3f1236 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -22,7 +22,7 @@ function aws_profiles { compctl -K aws_profiles asp if _homebrew-installed && _awscli-homebrew-installed ; then - _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh + _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh else _aws_zsh_completer_path=$(which aws_zsh_completer.sh) fi -- cgit v1.2.3-70-g09d2