mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-16 11:36:16 +08:00
fix(aws): use return instead of exit to avoid killing the shell (#13811)
This commit is contained in:
parent
3f6f72010f
commit
ffa8487bc7
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user