SECRETS_TEST_VERBOSE can be 0 (#816)

* `SECRETS_TEST_VERBOSE` can be `0`

* Update _git_secret_tools.sh
This commit is contained in:
Nikita Sobolev 2022-04-02 18:01:15 +03:00 committed by GitHub
parent db03c638d5
commit a97dd7ffa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -190,7 +190,7 @@ function _temporary_file {
# which will be removed on system exit.
temporary_filename=$(_os_based __temp_file) # is not `local` on purpose.
trap 'if [[ -f "$temporary_filename" ]]; then if [[ -n "$_SECRETS_VERBOSE" ]] || [[ -n "$SECRETS_TEST_VERBOSE" ]]; then echo "git-secret: cleaning up: $temporary_filename"; fi; rm -f "$temporary_filename"; fi;' EXIT
trap 'if [[ -f "$temporary_filename" ]]; then if [[ -n "$_SECRETS_VERBOSE" ]] || [[ "$SECRETS_TEST_VERBOSE" == 1 ]]; then echo "git-secret: cleaning up: $temporary_filename"; fi; rm -f "$temporary_filename"; fi;' EXIT
}

View File

@ -324,7 +324,7 @@ function unset_current_state {
stop_gpg_agent
# SECRETS_TEST_VERBOSE is experimental
if [[ -n "$SECRETS_TEST_VERBOSE" ]]; then
if [[ "$SECRETS_TEST_VERBOSE" == 1 ]]; then
# display the captured output as bats diagnostic (fd3, preceded by '# ')
sed "s/^/# $BATS_TEST_DESCRIPTION: VERBOSE OUTPUT: /" < "$TEST_OUTPUT_FILE" >&3
@ -352,7 +352,7 @@ function unset_current_state {
}
# show output if we wind up manually removing the test output file in a trap
trap 'if [[ -f "$TEST_OUTPUT_FILE" ]]; then if [[ -n "$SECRETS_TEST_VERBOSE" ]]; then echo "git-secret: test: cleaning up: $TEST_OUTPUT_FILE"; fi; rm -f "$TEST_OUTPUT_FILE"; fi;' EXIT
trap 'if [[ -f "$TEST_OUTPUT_FILE" ]]; then if [[ "$SECRETS_TEST_VERBOSE" == 1 ]]; then echo "git-secret: test: cleaning up: $TEST_OUTPUT_FILE"; fi; rm -f "$TEST_OUTPUT_FILE"; fi;' EXIT
function bats_diag_file {
local filename=$1