Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove superfluous / duplicate squared brakets from AWS profile definition #829

Merged
merged 2 commits into from Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 21 additions & 22 deletions liquidprompt
Expand Up @@ -2151,7 +2151,6 @@ _lp_software_collections_color() {
lp_software_collections_color="${LP_COLOR_VIRTUALENV}${lp_software_collections}${NO_COL}"
}


_lp_kubernetes_context() {
(( LP_ENABLE_KUBECONTEXT )) || return 2

Expand Down Expand Up @@ -2196,6 +2195,27 @@ _lp_kubernetes_context_color() {
lp_kubernetes_context_color="${LP_MARK_KUBECONTEXT}${LP_COLOR_KUBECONTEXT}${lp_kubernetes_context}${lp_kubernetes_namespace+:}${lp_kubernetes_namespace-}${NO_COL}"
}

_lp_aws_profile() {
(( LP_ENABLE_AWS_PROFILE )) || return 2

local ret

local aws_profile="${AWS_PROFILE-${AWS_DEFAULT_PROFILE-${AWS_VAULT-}}}"
if [[ -n $aws_profile ]]; then
__lp_escape "${aws_profile}"
lp_aws_profile=$ret
else
return 1
fi
}

_lp_aws_profile_color() {
unset lp_aws_profile_color
_lp_aws_profile || return "$?"

lp_aws_profile_color="${LP_COLOR_AWS_PROFILE}${lp_aws_profile}${NO_COL}"
}


_lp_cmake() {
(( LP_ENABLE_CMAKE )) || return 2
Expand Down Expand Up @@ -2492,27 +2512,6 @@ _lp_dirstack_color() {
lp_dirstack_color="${LP_COLOR_DIRSTACK}${LP_MARK_DIRSTACK}${lp_dirstack}${NO_COL}"
}

_lp_aws_profile() {
(( LP_ENABLE_AWS_PROFILE )) || return 2

local ret

local aws_profile="${AWS_PROFILE-${AWS_DEFAULT_PROFILE-${AWS_VAULT-}}}"
if [[ -n $aws_profile ]]; then
__lp_escape "${aws_profile}"
lp_aws_profile=$ret
else
return 1
fi
}

_lp_aws_profile_color() {
unset lp_aws_profile_color
_lp_aws_profile || return "$?"

lp_aws_profile_color="[${LP_COLOR_AWS_PROFILE}${lp_aws_profile}${NO_COL}]"
}

_lp_shell_level() {
(( LP_ENABLE_SHLVL )) || return 2

Expand Down