From bc9f0660cf5110ab2e517aac569931602ec83cff Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 6 Oct 2020 13:41:42 +0200 Subject: utils.sh local variables --- common/utils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common/utils.sh') diff --git a/common/utils.sh b/common/utils.sh index d6795d21..c21d9079 100644 --- a/common/utils.sh +++ b/common/utils.sh @@ -91,6 +91,7 @@ vault_environment__activate() { return 1 fi + local e="" for e in $(vault_environment__get); do if [ "$1" = "$e" ]; then print_info "environment '$1' is already active" @@ -98,7 +99,7 @@ vault_environment__activate() { fi done - err_out=$(("gpg/get-vault-pass-$1" > /dev/null) 2>&1) + local err_out=$(("gpg/get-vault-pass-$1" > /dev/null) 2>&1) if [ -n "$err_out" ]; then print_error "failed to activate environment: '$1' .. reading passphrase from 'gpg/get-vault-pass-$1' returned an error" return 1 @@ -114,14 +115,14 @@ vault_environment__activate() { } vault_environment__deactivate() { - local new_list if [ -z "$1" ]; then print_error "please specify an environment" return 2 fi - new_list="" + local new_list="" + local e="" for e in $(vault_environment__get); do if [ "$1" != "$e" ]; then if [ -z "$new_list" ]; then -- cgit v1.2.3