浏览代码

feat(aws): load profiles from credentials file (#11196)

Fixes #8472
Noam Cohen 2 年之前
父节点
当前提交
eb2147c715
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      plugins/aws/aws.plugin.zsh

+ 1 - 0
plugins/aws/aws.plugin.zsh

@@ -146,6 +146,7 @@ function aws_change_access_key() {
 }
 
 function aws_profiles() {
+  aws --no-cli-pager configure list-profiles 2> /dev/null && return
   [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
   grep --color=never -Eo '\[.*\]' "${AWS_CONFIG_FILE:-$HOME/.aws/config}" | sed -E 's/^[[:space:]]*\[(profile)?[[:space:]]*([^[:space:]]+)\][[:space:]]*$/\2/g'
 }