ffa8487bc740d76f481cf7cecde8a9571a36b00c

Author
SOUFIAN3HM <123272999+soufian3hm@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

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

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2index 0c43031df6b2a09b122b582af0f8443239ecd898..677bf3236f49d1f788ca9c9d88e88241bbddefc9 100644
 3--- a/plugins/aws/aws.plugin.zsh
 4+++ b/plugins/aws/aws.plugin.zsh
 5@@ -9,14 +9,14 @@ function agr() {
 6 # Update state file if enabled
 7 function _aws_update_state() {
 8   if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
 9-    test -d $(dirname ${AWS_STATE_FILE}) || exit 1
10+    test -d $(dirname ${AWS_STATE_FILE}) || return 1
11     echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}"
12   fi
13 }
14 
15 function _aws_clear_state() {
16   if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then
17-    test -d $(dirname ${AWS_STATE_FILE}) || exit 1
18+    test -d $(dirname ${AWS_STATE_FILE}) || return 1
19     echo -n > "${AWS_STATE_FILE}"
20   fi
21 }