mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-11-10 15:19:01 +03:00
26 lines
614 B
Bash
26 lines
614 B
Bash
|
# 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
|
||
|
}
|