diff --git a/post-install-cachyos.sh b/post-install-cachyos.sh index 7ad2690..6881414 100755 --- a/post-install-cachyos.sh +++ b/post-install-cachyos.sh @@ -3,6 +3,9 @@ set -euo pipefail LOG_FILE="$HOME/cachyos-post-install.log" +GIT_USER_NAME="Jose Lago" +GIT_USER_EMAIL="jose@lago.dev" + OFFICIAL_PACKAGES=( brave-browser chromium @@ -831,6 +834,33 @@ ZSHFASTFETCH log "Fastfetch config written to: $fastfetch_config" } + +configure_git_identity() { + log "Configuring global Git identity..." + + if ! command -v git >/dev/null 2>&1; then + warn "git is not available. Skipping Git identity configuration." + return + fi + + current_git_name="$(git config --global --get user.name || true)" + current_git_email="$(git config --global --get user.email || true)" + + if [[ "$current_git_name" == "$GIT_USER_NAME" ]]; then + log "Git user.name already set to: $GIT_USER_NAME" + else + git config --global user.name "$GIT_USER_NAME" + log "Git user.name set to: $GIT_USER_NAME" + fi + + if [[ "$current_git_email" == "$GIT_USER_EMAIL" ]]; then + log "Git user.email already set to: $GIT_USER_EMAIL" + else + git config --global user.email "$GIT_USER_EMAIL" + log "Git user.email set to: $GIT_USER_EMAIL" + fi +} + post_checks() { log "Quick checks..." @@ -864,6 +894,7 @@ main() { full_system_update install_drivers_with_chwd install_official_packages + configure_git_identity remove_ptyxis_and_konsole_install_ghostty configure_ghostty configure_zsh_ohmyzsh_powerlevel10k