small fixes

This commit is contained in:
teldra 2022-06-26 20:11:27 +02:00
parent d91f558cda
commit f3fcb4f9e5
1 changed files with 27 additions and 0 deletions

27
push.sh
View File

@ -1,5 +1,32 @@
#!/bin/bash
# check if user has configured a name in git and set it, if not
if ! grep name ~/.gitconfig && ! grep name ~/.git/config; then
echo "You need a name! It is not important. If you choose none, it will be 'buha'."
echo "Write 'exit' or press 'Strg+c' to cancel."
read -p ": " name
if [ "${name}" == "exit" ]; then
exit
fi
if [ "${name}" == "" ]; then
name="buha"
fi
git config user.name "${name}"
fi
if ! grep email ~/.gitconfig && ! grep email ~/.git/config; then
echo "You need an email! It is not important. If you choose none, it will be 'info@bunteshaus.de'."
echo "Write 'exit' or press 'Strg+c' to cancel."
read -p ": " email
if [ "${email}" == "exit" ]; then
exit
fi
if [ "${email}" == "" ]; then
email="buha"
fi
git config user.email "${email}"
fi
# update from upstream/main
git pull --rebase upstream main && \