From f3fcb4f9e5eecafa5d6b92ec43e67f5bbf213c50 Mon Sep 17 00:00:00 2001 From: teldra Date: Sun, 26 Jun 2022 20:11:27 +0200 Subject: [PATCH] small fixes --- push.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/push.sh b/push.sh index 7a63f6b5..70264548 100755 --- a/push.sh +++ b/push.sh @@ -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 && \