[bin] Cleaning up bootstrap and setup scripts

This commit is contained in:
2026-02-27 17:17:08 -05:00
parent dc5912e23d
commit 3ecaa8b389
2 changed files with 293 additions and 277 deletions

View File

@ -98,7 +98,7 @@ esac
# -------- Clone/update dotfiles --------
if [[ -d "$DOTFILES_DIR/.git" ]]; then
log "Updating dotfiles in $DOTFILES_DIR..."
git -C "$DOTFILES_DIR" pull --rebase
git -C "$DOTFILES_DIR" pull --rebase || log "Warning: could not update dotfiles, continuing..."
else
log "Cloning dotfiles to $DOTFILES_DIR..."
git clone "$DOTFILES_REPO" "$DOTFILES_DIR"
@ -129,32 +129,18 @@ else
git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$OMZ_DIR"
fi
# -------- Doom Emacs --------
if [[ -d "$DOOM_DIR/.git" ]]; then
log "Doom Emacs already present at $DOOM_DIR (updating)..."
git -C "$DOOM_DIR" pull --rebase || true
elif [[ -e "$DOOM_DIR" ]]; then
log "Skipping Doom Emacs clone because $DOOM_DIR exists but is not a git repo."
log "Move it aside if you want to install Doom there."
else
log "Cloning Doom Emacs to $DOOM_DIR..."
git clone --depth=1 https://github.com/doomemacs/doomemacs "$DOOM_DIR"
fi
# -------- Set zsh as default shell --------
log "Setting zsh as default shell..."
ZSH_PATH="$(command -v zsh)"
case "$PLATFORM" in
macos)
sudo -u "$USER" chsh -s "$ZSH_PATH" || chsh -s "$ZSH_PATH"
;;
*)
sudo chsh -s "$ZSH_PATH" "$USER" || sudo usermod -s "$ZSH_PATH" "$USER" || chsh -s "$ZSH_PATH"
;;
esac
# -------- Next steps --------
log "Next steps"
cat <<'EOF'
1) Start a new shell (or open a new terminal) so shell config reloads.
2) If you want zsh as default:
- Linux: chsh -s $(command -v zsh)
- macOS: chsh -s /bin/zsh (or $(command -v zsh) if preferred)
- FreeBSD: chsh -s $(command -v zsh)
3) Doom Emacs:
~/.emacs.d/bin/doom install
(And later, when you change config: ~/.emacs.d/bin/doom sync)
EOF
log "Please open a new shell or terminal so your shell config reloads."
log "Done."

View File

@ -251,6 +251,9 @@ fedora)
fi
install_opencode
log "Final system upgrade..."
sudo dnf -y upgrade
;;
arch)
@ -265,6 +268,9 @@ arch)
aur_install_if_possible google-chrome slack-desktop || true
log "Final system upgrade..."
sudo pacman -Syu --noconfirm
install_opencode
;;
@ -284,6 +290,9 @@ macos)
fi
install_opencode
log "Final system upgrade..."
brew upgrade
;;
freebsd)
@ -307,6 +316,9 @@ freebsd)
# Optional stuff from your history where it makes sense
pkg_install_best_effort "${FREEBSD_MISC[@]}"
log "Final system upgrade..."
sudo pkg upgrade -y
log "FreeBSD notes:"
cat <<'EOF'
- 'pass' is installed as 'password-store' on FreeBSD; command is still: pass
@ -333,3 +345,21 @@ cat <<'EOF'
EOF
log "Done."
# -------- Doom Emacs --------
DOOM_DIR="${DOOM_DIR:-$HOME/.emacs.d}"
if [[ -d "$DOOM_DIR/.git" ]]; then
log "Doom Emacs already present at $DOOM_DIR (updating)..."
git -C "$DOOM_DIR" pull --rebase || true
elif [[ -e "$DOOM_DIR" ]]; then
log "Skipping Doom Emacs clone because $DOOM_DIR exists but is not a git repo."
log "Move it aside if you want to install Doom there."
else
log "Cloning Doom Emacs to $DOOM_DIR..."
git clone --depth=1 https://github.com/doomemacs/doomemacs "$DOOM_DIR"
fi
if [[ -d "$DOOM_DIR" ]]; then
log "Installing Doom Emacs..."
"$DOOM_DIR/bin/doom" install
fi