diff --git a/ubuntu-post-install.sh b/ubuntu-post-install.sh index 09f5882..d12e266 100755 --- a/ubuntu-post-install.sh +++ b/ubuntu-post-install.sh @@ -193,6 +193,37 @@ print_status "Installazione strumenti di sviluppo..." sudo apt install -y git check_command "Git" +# === CONFIGURAZIONE GIT === +print_status "Configurazione Git..." + +# Richiesta credenziali Git se non sono giĆ  impostate come variabili d'ambiente +if [ -z "$GIT_USERNAME" ]; then + read -p "Inserisci il tuo nome utente Git: " GIT_USERNAME +fi + +if [ -z "$GIT_EMAIL" ]; then + read -p "Inserisci la tua email Git: " GIT_EMAIL +fi + +if [ -z "$GITEA_USERNAME" ]; then + read -p "Inserisci il tuo username Gitea: " GITEA_USERNAME +fi + +if [ -z "$GITEA_PASSWORD" ]; then + read -s -p "Inserisci la tua password Gitea: " GITEA_PASSWORD + echo +fi + +# Configurazione globale Git +git config --global user.name "$GIT_USERNAME" +git config --global user.email "$GIT_EMAIL" +git config --global init.defaultBranch main + +# Configurazione credenziali per il server Gitea +git config --global credential."https://gitbat.duckdns.org:44443".username "$GITEA_USERNAME" + +print_success "Git configurato per $GIT_USERNAME ($GIT_EMAIL)" + # Python sudo apt install -y python3 check_command "Python3"