From 9a2cb6c20368e3048e7634c3e3f5f542e64c18ee Mon Sep 17 00:00:00 2001 From: TareqSifat Date: Sun, 1 Dec 2024 19:05:56 +0600 Subject: [PATCH] added null check on user --- install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install b/install index 8233f44..6174078 100755 --- a/install +++ b/install @@ -830,7 +830,12 @@ wo_init() { fi fi if [ "$wo_force_install" = "y" ]; then - [ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; } + # Check if USER is empty and assign to a variable + USER_OR_WORDOPS=${USER:-WordOps} + + [ ! -f "$HOME/.gitconfig" ] && { + bash -c "echo -e \"[user]\n\tname = $USER_OR_WORDOPS\n\temail = root@$HOSTNAME.local\" > $HOME/.gitconfig"; + } fi if [ -f ./setup.py ]; then wo_version_new=$(grep "version='" setup.py | awk -F "'" '{print $2}' 2>&1)