You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git-secret/utils/pre-commit.sh

22 lines
340 B
Bash

#!/usr/bin/env bash
set -e
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [[ $BRANCH_NAME != '(no branch)' ]]; then
unset GIT_WORK_TREE
# 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