fix(aws): use return instead of exit to avoid killing the shell (#13811)

This commit is contained in:
SOUFIAN3HM 2026-06-15 10:56:22 +01:00 committed by GitHub
parent 3f6f72010f
commit ffa8487bc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,14 +9,14 @@ function agr() {
# Update state file if enabled # Update state file if enabled
function _aws_update_state() { function _aws_update_state() {
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
test -d $(dirname ${AWS_STATE_FILE}) || exit 1 test -d $(dirname ${AWS_STATE_FILE}) || return 1
echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}" echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}"
fi fi
} }
function _aws_clear_state() { function _aws_clear_state() {
if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
test -d $(dirname ${AWS_STATE_FILE}) || exit 1 test -d $(dirname ${AWS_STATE_FILE}) || return 1
echo -n > "${AWS_STATE_FILE}" echo -n > "${AWS_STATE_FILE}"
fi fi
} }