diff --git a/install.sh b/install.sh index 9f3325f..8c5fad9 100755 --- a/install.sh +++ b/install.sh @@ -11,6 +11,21 @@ function do_stow() { stow "${opts[@]}" "$package" } +function basic_git_setup() { + if ! command -v git &> /dev/null; then + echo "[!] Git is not installed! Not running git setup." + return 1 + fi + + git config --global user.name "Hans Goor" + git config --global user.email "me@eyedevelop.org" + git config --global push.autoSetupRemote true + git config --global pull.rebase true + git config --global commit.gpgsign true + git config --global merge.ff no + git config --global init.defaultBranch main +} + set -eo pipefail DOTFILES_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" @@ -28,7 +43,7 @@ mkdir -p "${TARGET_DIR}/.config" # Install SSH separately, as it requres a different target. do_stow ssh "${TARGET_DIR}/.ssh" || true do_stow tmux || true -do_stow git || true +do_stow git || (basic_git_setup || true) do_stow zsh || true do_stow nvim "${TARGET_DIR}/.config" || true