mirror of
https://github.com/sobolevn/git-secret
synced 2024-11-18 15:26:58 +00:00
549cd9aa24
* check for encrypted version of file before decrypting, for #706 * improve error messages, verbose output and non-verbose output * in tests, prefix output from git init with 'git: ' * 'clean' options only remove added files, for #833 * update changelog
32 lines
729 B
Bash
Executable File
32 lines
729 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# `SECRETS_PROJECT_ROOT` must be set before running the script.
|
|
|
|
set -e
|
|
|
|
TEST_DIR=/tmp/git-secret-test
|
|
|
|
rm -rf "${TEST_DIR}"
|
|
mkdir "${TEST_DIR}"
|
|
echo "# created dir: ${TEST_DIR}"
|
|
|
|
chmod 0700 "${TEST_DIR}"
|
|
(
|
|
cd "$TEST_DIR"
|
|
|
|
# test with non-standard SECRETS_DIR (normally .gitsecret)
|
|
# and SECRETS_EXTENSION (normally .secret)
|
|
export SECRETS_DIR='.gitsec'
|
|
export SECRETS_EXTENSION='.sec'
|
|
|
|
export TMPDIR="$TEST_DIR"
|
|
echo "# TMPDIR is $TMPDIR"
|
|
|
|
# bats expects diagnostic lines to be sent to fd 3, matching regex '^# '
|
|
# (IE, like: `echo '# message here' >&3`).
|
|
# bats ... 3>&1 shows diagnostic output
|
|
bats "${SECRETS_PROJECT_ROOT}/tests" 3>&1
|
|
)
|
|
|
|
rm -rf "${TEST_DIR}"
|