added null check on user

This commit is contained in:
TareqSifat
2024-12-01 19:05:56 +06:00
parent 0f0c6a0488
commit 9a2cb6c203

View File

@@ -830,7 +830,12 @@ wo_init() {
fi fi
fi fi
if [ "$wo_force_install" = "y" ]; then 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 fi
if [ -f ./setup.py ]; then if [ -f ./setup.py ]; then
wo_version_new=$(grep "version='" setup.py | awk -F "'" '{print $2}' 2>&1) wo_version_new=$(grep "version='" setup.py | awk -F "'" '{print $2}' 2>&1)