From d79941b78997f7c11e247c08678fd57827db3b42 Mon Sep 17 00:00:00 2001 From: Lutz Horn Date: Thu, 9 Jul 2020 10:43:59 +0200 Subject: aws: allow @ in AWS profiles (#9099) Fixes #9060 by matching a `@` in the AWS profile name. --- 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 4b5446407..d00c2e56c 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -41,7 +41,7 @@ function aws_change_access_key() { function aws_profiles() { [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1 - grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/' + grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9@_\.-]*\).*/\1/' } function _aws_profiles() { -- cgit v1.2.3-70-g09d2 From db3d05fe7184a523fe4aba120bea962114424573 Mon Sep 17 00:00:00 2001 From: Amir Tahvildaran Date: Sat, 18 Jul 2020 13:06:08 -0400 Subject: 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. --- 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 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 -- cgit v1.2.3-70-g09d2