mirror of https://github.com/akelge/zsh
Fixed regexp matching for AWS Profile
This commit is contained in:
parent
8f59e40efb
commit
c1f65b90e7
|
@ -119,6 +119,8 @@ prompt_pure_set_colors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_pure_set_aws() {
|
prompt_pure_set_aws() {
|
||||||
|
# YOu can change the pattern to match AWS prod profiles with
|
||||||
|
# zstyle :awsprofile:prod name pattern , e.g. ^prod
|
||||||
local _aws_prod_profile
|
local _aws_prod_profile
|
||||||
prompt_pure_aws_prod=0
|
prompt_pure_aws_prod=0
|
||||||
prompt_pure_aws=
|
prompt_pure_aws=
|
||||||
|
@ -126,10 +128,11 @@ prompt_pure_set_aws() {
|
||||||
if [[ -n $AWS_PROFILE ]]; then
|
if [[ -n $AWS_PROFILE ]]; then
|
||||||
zstyle -g _aws_prod_profile ':awsprofile:prod' 'name'
|
zstyle -g _aws_prod_profile ':awsprofile:prod' 'name'
|
||||||
if [[ -z $_aws_prod_profile ]]; then
|
if [[ -z $_aws_prod_profile ]]; then
|
||||||
_aws_prod_profile='prod'
|
#Default pattern if nome specified
|
||||||
|
_aws_prod_profile='^prod'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$AWS_PROFILE" == "$_aws_prod_profile" ]]; then
|
if [[ "$AWS_PROFILE" =~ "$_aws_prod_profile" ]]; then
|
||||||
prompt_pure_aws_prod=1
|
prompt_pure_aws_prod=1
|
||||||
fi
|
fi
|
||||||
prompt_pure_aws="/$AWS_PROFILE/"
|
prompt_pure_aws="/$AWS_PROFILE/"
|
||||||
|
|
Loading…
Reference in New Issue