mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-28 05:56:07 +02:00
fix(aws): stop listing sso-session blocks as profiles
The fallback used when the aws binary is missing matched every bracketed header, so 'aws_profiles' emitted '[sso-session name]' and '[services name]' verbatim alongside real profile names. Only match headers that hold a single unspaced name, optionally prefixed with 'profile'. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
756ce726f5
commit
01271d0ad6
@@ -241,7 +241,7 @@ function aws_regions() {
|
||||
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'
|
||||
grep --color=never -Eo '^\[[[:space:]]*(profile[[:space:]]+)?[^][:space:]]+[[:space:]]*\]' "${AWS_CONFIG_FILE:-$HOME/.aws/config}" | sed -E 's/^\[[[:space:]]*(profile[[:space:]]+)?([^][:space:]]+)[[:space:]]*\]$/\2/'
|
||||
}
|
||||
|
||||
function _aws_regions() {
|
||||
|
||||
Reference in New Issue
Block a user