mirror of
https://github.com/sobolevn/git-secret
synced 2024-11-08 19:10:31 +00:00
5a28744c5d
* fix test under githooks, fix typos, mention #334 as relevant
27 lines
570 B
Bash
Executable File
27 lines
570 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
BRANCH_NAME=$(git branch | grep '\*' | sed 's/* //')
|
|
|
|
if [[ "$BRANCH_NAME" != '(no branch)' ]]; then
|
|
unset GIT_WORK_TREE
|
|
|
|
# Set marker, that we running tests from `git commit`,
|
|
# so some tests will be skipped. It is done, because `git rev-parse`
|
|
# is not working when running from pre-commit hook. See #334
|
|
export BATS_RUNNING_FROM_GIT=1
|
|
|
|
# Run tests:
|
|
make test
|
|
|
|
if [[ "$BRANCH_NAME" == "master" ]]; then
|
|
# Build new manuals:
|
|
make build-man
|
|
|
|
# Add new files:
|
|
git add man/man1/*
|
|
git add man/man7/*
|
|
fi
|
|
fi
|