haskell.nix/scripts/git.env

26 lines
614 B
Bash
Raw Normal View History

# Env variables and functions for updating git repos
export GIT_COMMITTER_NAME="IOHK"
export GIT_COMMITTER_EMAIL="devops+nix-tools@iohk.io"
export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME"
export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL"
use_ssh_key() {
sshkey=$1
if [ -e $sshkey ]
then
echo "Authenticating using SSH with $sshkey"
export GIT_SSH_COMMAND="ssh -i $sshkey -F /dev/null"
else
echo "There is no SSH key at $sshkey"
echo "Git push may not work."
fi
}
check_staged() {
if git diff-index --cached --quiet HEAD --; then
echo "No changes to commit, exiting."
exit 0
fi
}