From 3ecaa8b3890b2e9498ae268b3310454925a02bbf Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 27 Feb 2026 17:17:08 -0500 Subject: [PATCH] [bin] Cleaning up bootstrap and setup scripts --- bin/.local/bin/bootstrap.sh | 160 +++++++------- bin/.local/bin/setup.sh | 410 +++++++++++++++++++----------------- 2 files changed, 293 insertions(+), 277 deletions(-) diff --git a/bin/.local/bin/bootstrap.sh b/bin/.local/bin/bootstrap.sh index 24b600f..94b9975 100755 --- a/bin/.local/bin/bootstrap.sh +++ b/bin/.local/bin/bootstrap.sh @@ -14,78 +14,78 @@ PLATFORM="" # -------- Detect platform -------- if [[ "$OS" == "Darwin" ]]; then - PLATFORM="macos" + PLATFORM="macos" elif [[ "$OS" == "FreeBSD" ]]; then - PLATFORM="freebsd" + PLATFORM="freebsd" elif [[ "$OS" == "Linux" ]]; then - if [[ -r /etc/os-release ]]; then - # shellcheck disable=SC1091 - . /etc/os-release - fi + if [[ -r /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + fi - is_arch=0 - case "${ID:-}" in - arch | endeavouros) is_arch=1 ;; - esac - if [[ $is_arch -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qi arch; then - is_arch=1 - fi + is_arch=0 + case "${ID:-}" in + arch | endeavouros) is_arch=1 ;; + esac + if [[ $is_arch -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qi arch; then + is_arch=1 + fi - is_fedora=0 - case "${ID:-}" in - fedora) is_fedora=1 ;; - esac - if [[ $is_fedora -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qiE 'fedora|rhel'; then - is_fedora=1 - fi + is_fedora=0 + case "${ID:-}" in + fedora) is_fedora=1 ;; + esac + if [[ $is_fedora -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qiE 'fedora|rhel'; then + is_fedora=1 + fi - if [[ $is_arch -eq 1 ]]; then - PLATFORM="arch" - elif [[ $is_fedora -eq 1 ]]; then - PLATFORM="fedora" - else - echo "Unsupported Linux distro (ID=${ID:-unknown}, ID_LIKE=${ID_LIKE:-unknown})." - exit 1 - fi + if [[ $is_arch -eq 1 ]]; then + PLATFORM="arch" + elif [[ $is_fedora -eq 1 ]]; then + PLATFORM="fedora" + else + echo "Unsupported Linux distro (ID=${ID:-unknown}, ID_LIKE=${ID_LIKE:-unknown})." + exit 1 + fi else - echo "Unsupported OS: $OS" - exit 1 + echo "Unsupported OS: $OS" + exit 1 fi # -------- Install basics (git, stow, zsh, curl, make) -------- install_arch() { - log "Installing prerequisites (Arch/EndeavourOS)..." - sudo pacman -Sy --needed --noconfirm git stow zsh curl make openssh + log "Installing prerequisites (Arch/EndeavourOS)..." + sudo pacman -Sy --needed --noconfirm git stow zsh curl make openssh } install_fedora() { - log "Installing prerequisites (Fedora)..." - sudo dnf install -y git stow zsh curl make openssh-clients + log "Installing prerequisites (Fedora)..." + sudo dnf install -y git stow zsh curl make openssh-clients } install_macos() { - log "Ensuring Homebrew..." - if ! have brew; then - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - fi + log "Ensuring Homebrew..." + if ! have brew; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi - # shellenv for both Apple Silicon and Intel - if [[ -x /opt/homebrew/bin/brew ]]; then - eval "$(/opt/homebrew/bin/brew shellenv)" - elif [[ -x /usr/local/bin/brew ]]; then - eval "$(/usr/local/bin/brew shellenv)" - fi + # shellenv for both Apple Silicon and Intel + if [[ -x /opt/homebrew/bin/brew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + elif [[ -x /usr/local/bin/brew ]]; then + eval "$(/usr/local/bin/brew shellenv)" + fi - log "Installing prerequisites (macOS via brew)..." - brew update - brew install git stow zsh curl gnu-make + log "Installing prerequisites (macOS via brew)..." + brew update + brew install git stow zsh curl gnu-make } install_freebsd() { - log "Installing prerequisites (FreeBSD)..." - sudo pkg update -f - # gmake is GNU make; stow is stow; git/curl/zsh are available - sudo pkg install -y git stow zsh curl gmake + log "Installing prerequisites (FreeBSD)..." + sudo pkg update -f + # gmake is GNU make; stow is stow; git/curl/zsh are available + sudo pkg install -y git stow zsh curl gmake } case "$PLATFORM" in @@ -97,20 +97,20 @@ esac # -------- Clone/update dotfiles -------- if [[ -d "$DOTFILES_DIR/.git" ]]; then - log "Updating dotfiles in $DOTFILES_DIR..." - git -C "$DOTFILES_DIR" pull --rebase + log "Updating dotfiles in $DOTFILES_DIR..." + 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" + log "Cloning dotfiles to $DOTFILES_DIR..." + git clone "$DOTFILES_REPO" "$DOTFILES_DIR" fi # -------- Build/apply dotfiles (make vs gmake) -------- MAKE_CMD="make" if [[ "$PLATFORM" == "freebsd" ]]; then - MAKE_CMD="gmake" + MAKE_CMD="gmake" elif [[ "$PLATFORM" == "macos" ]]; then - # prefer GNU make if available (brew installs as gmake) - if have gmake; then MAKE_CMD="gmake"; fi + # prefer GNU make if available (brew installs as gmake) + if have gmake; then MAKE_CMD="gmake"; fi fi log "Backing up existing files" @@ -123,38 +123,24 @@ log "Running $MAKE_CMD in dotfiles repo..." # -------- oh-my-zsh -------- if [[ -d "$OMZ_DIR" ]]; then - log "oh-my-zsh already present at $OMZ_DIR" + log "oh-my-zsh already present at $OMZ_DIR" else - log "Cloning oh-my-zsh..." - git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$OMZ_DIR" + log "Cloning oh-my-zsh..." + 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." diff --git a/bin/.local/bin/setup.sh b/bin/.local/bin/setup.sh index 118b9a4..c3e876d 100755 --- a/bin/.local/bin/setup.sh +++ b/bin/.local/bin/setup.sh @@ -9,151 +9,151 @@ PLATFORM="" # -------- OS detection -------- if [[ "$OS" == "Darwin" ]]; then - PLATFORM="macos" + PLATFORM="macos" elif [[ "$OS" == "FreeBSD" ]]; then - PLATFORM="freebsd" + PLATFORM="freebsd" elif [[ "$OS" == "Linux" ]]; then - if [[ -r /etc/os-release ]]; then - # shellcheck disable=SC1091 - . /etc/os-release - fi + if [[ -r /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + fi - is_arch=0 - case "${ID:-}" in - arch | endeavouros) is_arch=1 ;; - esac - if [[ $is_arch -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qi arch; then - is_arch=1 - fi + is_arch=0 + case "${ID:-}" in + arch | endeavouros) is_arch=1 ;; + esac + if [[ $is_arch -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qi arch; then + is_arch=1 + fi - is_fedora=0 - case "${ID:-}" in - fedora) is_fedora=1 ;; - esac - if [[ $is_fedora -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qiE 'fedora|rhel'; then - is_fedora=1 - fi + is_fedora=0 + case "${ID:-}" in + fedora) is_fedora=1 ;; + esac + if [[ $is_fedora -eq 0 && -n "${ID_LIKE:-}" ]] && echo "$ID_LIKE" | grep -qiE 'fedora|rhel'; then + is_fedora=1 + fi - if [[ $is_arch -eq 1 ]]; then - PLATFORM="arch" - elif [[ $is_fedora -eq 1 ]]; then - PLATFORM="fedora" - else - echo "Unsupported Linux distro (ID=${ID:-unknown}, ID_LIKE=${ID_LIKE:-unknown})." - exit 1 - fi + if [[ $is_arch -eq 1 ]]; then + PLATFORM="arch" + elif [[ $is_fedora -eq 1 ]]; then + PLATFORM="fedora" + else + echo "Unsupported Linux distro (ID=${ID:-unknown}, ID_LIKE=${ID_LIKE:-unknown})." + exit 1 + fi else - echo "Unsupported OS: $OS" - exit 1 + echo "Unsupported OS: $OS" + exit 1 fi # -------- Helpers -------- install_pacman() { - local pkgs=("$@") - log "pacman install: ${pkgs[*]}" - sudo pacman -Sy --needed --noconfirm "${pkgs[@]}" + local pkgs=("$@") + log "pacman install: ${pkgs[*]}" + sudo pacman -Sy --needed --noconfirm "${pkgs[@]}" } install_dnf() { - local pkgs=("$@") - log "dnf install: ${pkgs[*]}" - sudo dnf install -y "${pkgs[@]}" + local pkgs=("$@") + log "dnf install: ${pkgs[*]}" + sudo dnf install -y "${pkgs[@]}" } brew_install() { - local pkgs=("$@") - log "brew install: ${pkgs[*]}" - brew install "${pkgs[@]}" + local pkgs=("$@") + log "brew install: ${pkgs[*]}" + brew install "${pkgs[@]}" } brew_cask() { - local pkgs=("$@") - log "brew install --cask: ${pkgs[*]}" - brew install --cask "${pkgs[@]}" + local pkgs=("$@") + log "brew install --cask: ${pkgs[*]}" + brew install --cask "${pkgs[@]}" } install_pkg() { - local pkgs=("$@") - log "pkg install: ${pkgs[*]}" - sudo pkg install -y "${pkgs[@]}" + local pkgs=("$@") + log "pkg install: ${pkgs[*]}" + sudo pkg install -y "${pkgs[@]}" } # Best-effort install loops (skip missing packages cleanly) dnf_install_best_effort() { - local pkgs=("$@") - for p in "${pkgs[@]}"; do - if sudo dnf info "$p" >/dev/null 2>&1; then - install_dnf "$p" - else - log "Skipping (dnf not found): $p" - fi - done + local pkgs=("$@") + for p in "${pkgs[@]}"; do + if sudo dnf info "$p" >/dev/null 2>&1; then + install_dnf "$p" + else + log "Skipping (dnf not found): $p" + fi + done } pacman_install_best_effort() { - local pkgs=("$@") - for p in "${pkgs[@]}"; do - if pacman -Si "$p" >/dev/null 2>&1; then - install_pacman "$p" - else - log "Skipping (pacman not found): $p" - fi - done + local pkgs=("$@") + for p in "${pkgs[@]}"; do + if pacman -Si "$p" >/dev/null 2>&1; then + install_pacman "$p" + else + log "Skipping (pacman not found): $p" + fi + done } pkg_install_best_effort() { - local pkgs=("$@") - for p in "${pkgs[@]}"; do - if pkg search -q "^${p}$" >/dev/null 2>&1; then - install_pkg "$p" - else - log "Skipping (pkg not found): $p" - fi - done + local pkgs=("$@") + for p in "${pkgs[@]}"; do + if pkg search -q "^${p}$" >/dev/null 2>&1; then + install_pkg "$p" + else + log "Skipping (pkg not found): $p" + fi + done } aur_install_if_possible() { - local pkgs=("$@") - if have yay; then - log "AUR install via yay: ${pkgs[*]}" - yay -S --needed --noconfirm "${pkgs[@]}" - else - log "Skipping AUR packages (yay not found): ${pkgs[*]}" - fi + local pkgs=("$@") + if have yay; then + log "AUR install via yay: ${pkgs[*]}" + yay -S --needed --noconfirm "${pkgs[@]}" + else + log "Skipping AUR packages (yay not found): ${pkgs[*]}" + fi } install_opencode() { - if have opencode; then - log "opencode already installed" - return 0 - fi - if have npm; then - log "Installing opencode via npm..." - npm install -g opencode-ai - else - log "Skipping opencode (npm not found)" - fi + if have opencode; then + log "opencode already installed" + return 0 + fi + if have npm; then + log "Installing opencode via npm..." + npm install -g opencode-ai + else + log "Skipping opencode (npm not found)" + fi } ensure_brew() { - if have brew; then return 0; fi - log "Homebrew not found; installing Homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if have brew; then return 0; fi + log "Homebrew not found; installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - if [[ -x /opt/homebrew/bin/brew ]]; then - eval "$(/opt/homebrew/bin/brew shellenv)" - elif [[ -x /usr/local/bin/brew ]]; then - eval "$(/usr/local/bin/brew shellenv)" - fi + if [[ -x /opt/homebrew/bin/brew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + elif [[ -x /usr/local/bin/brew ]]; then + eval "$(/usr/local/bin/brew shellenv)" + fi } ensure_flathub() { - if ! have flatpak; then - log "flatpak not installed; skipping flathub apps." - return 0 - fi - log "Ensuring Flathub remote exists..." - sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + if ! have flatpak; then + log "flatpak not installed; skipping flathub apps." + return 0 + fi + log "Ensuring Flathub remote exists..." + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo } # -------- Package sets (portable intent) -------- @@ -169,52 +169,52 @@ UTILS_LINUX=(gnuplot graphviz shfmt shellcheck pandoc) DESKTOP_LINUX=(kitty alacritty dino syncthing) FEDORA_EXTRAS=( - gnome-extensions-app - gnome-tweaks - spice-vdagent - kernel-modules-extra - pinentry-tty - NetworkManager-openvpn-gnome - openvpn - openvpn3-client - libpq-devel - postgresql - pass-otp - chromium - google-chrome-stable + gnome-extensions-app + gnome-tweaks + spice-vdagent + kernel-modules-extra + pinentry-tty + NetworkManager-openvpn-gnome + openvpn + openvpn3-client + libpq-devel + postgresql + pass-otp + chromium + google-chrome-stable ) ARCH_EXTRAS=( - gnome-extensions-app - gnome-tweaks - spice-vdagent - linux-headers - pinentry - networkmanager-openvpn - openvpn - postgresql-libs - postgresql - pass-otp - chromium - snapcast + gnome-extensions-app + gnome-tweaks + spice-vdagent + linux-headers + pinentry + networkmanager-openvpn + openvpn + postgresql-libs + postgresql + pass-otp + chromium + snapcast ) MAC_BREW_PKGS=( - fzf direnv stow pass just - fd editorconfig git - cmake libtool - gnuplot graphviz shfmt shellcheck pandoc - postgresql - syncthing - pinentry-mac + fzf direnv stow pass just + fd editorconfig git + cmake libtool + gnuplot graphviz shfmt shellcheck pandoc + postgresql + syncthing + pinentry-mac ) MAC_CASKS=( - kitty - alacritty - slack - google-chrome - chromium + kitty + alacritty + slack + google-chrome + chromium ) # FreeBSD name mapping (best-effort) @@ -235,85 +235,97 @@ FREEBSD_MISC=(postgresql16-client syncthing) # -------- Install per-platform -------- case "$PLATFORM" in fedora) - log "Platform: Fedora. Refreshing + upgrading..." - sudo dnf -y upgrade --refresh || true + log "Platform: Fedora. Refreshing + upgrading..." + sudo dnf -y upgrade --refresh || true - install_dnf "${CORE_CLI[@]}" "${EXTRA_CLI[@]}" || true - dnf_install_best_effort "${DEV_TOOLS_LINUX[@]}" - dnf_install_best_effort "${UTILS_LINUX[@]}" - dnf_install_best_effort "${DESKTOP_LINUX[@]}" - dnf_install_best_effort "${FEDORA_EXTRAS[@]}" + install_dnf "${CORE_CLI[@]}" "${EXTRA_CLI[@]}" || true + dnf_install_best_effort "${DEV_TOOLS_LINUX[@]}" + dnf_install_best_effort "${UTILS_LINUX[@]}" + dnf_install_best_effort "${DESKTOP_LINUX[@]}" + dnf_install_best_effort "${FEDORA_EXTRAS[@]}" - ensure_flathub - if have flatpak; then - log "Optional: Slack via Flatpak" - sudo flatpak install -y flathub com.slack.Slack || true - fi + ensure_flathub + if have flatpak; then + log "Optional: Slack via Flatpak" + sudo flatpak install -y flathub com.slack.Slack || true + fi - install_opencode - ;; + install_opencode + + log "Final system upgrade..." + sudo dnf -y upgrade + ;; arch) - log "Platform: EndeavourOS/Arch. Updating package databases..." - sudo pacman -Sy --noconfirm + log "Platform: EndeavourOS/Arch. Updating package databases..." + sudo pacman -Sy --noconfirm - install_pacman "${CORE_CLI[@]}" "${EXTRA_CLI[@]}" - pacman_install_best_effort "${DEV_TOOLS_LINUX[@]}" - pacman_install_best_effort "${UTILS_LINUX[@]}" - pacman_install_best_effort "${DESKTOP_LINUX[@]}" - pacman_install_best_effort "${ARCH_EXTRAS[@]}" + install_pacman "${CORE_CLI[@]}" "${EXTRA_CLI[@]}" + pacman_install_best_effort "${DEV_TOOLS_LINUX[@]}" + pacman_install_best_effort "${UTILS_LINUX[@]}" + pacman_install_best_effort "${DESKTOP_LINUX[@]}" + pacman_install_best_effort "${ARCH_EXTRAS[@]}" - aur_install_if_possible google-chrome slack-desktop || true + aur_install_if_possible google-chrome slack-desktop || true - install_opencode - ;; + log "Final system upgrade..." + sudo pacman -Syu --noconfirm + + install_opencode + ;; macos) - log "Platform: macOS. Ensuring Homebrew..." - ensure_brew + log "Platform: macOS. Ensuring Homebrew..." + ensure_brew - log "Updating Homebrew..." - brew update + log "Updating Homebrew..." + brew update - brew_install "${MAC_BREW_PKGS[@]}" - brew_cask "${MAC_CASKS[@]}" || true + brew_install "${MAC_BREW_PKGS[@]}" + brew_cask "${MAC_CASKS[@]}" || true - if [[ -f "$(brew --prefix)/opt/fzf/install" ]]; then - log "Tip: run fzf install helper if you want keybindings/completion:" - echo " $(brew --prefix)/opt/fzf/install" - fi + if [[ -f "$(brew --prefix)/opt/fzf/install" ]]; then + log "Tip: run fzf install helper if you want keybindings/completion:" + echo " $(brew --prefix)/opt/fzf/install" + fi - install_opencode - ;; + install_opencode + + log "Final system upgrade..." + brew upgrade + ;; freebsd) - log "Platform: FreeBSD. Updating pkg metadata..." - sudo pkg update -f + log "Platform: FreeBSD. Updating pkg metadata..." + sudo pkg update -f - # Ensure basic SSL certs exist for fetches/tools that need it - pkg_install_best_effort ca_root_nss || true + # Ensure basic SSL certs exist for fetches/tools that need it + pkg_install_best_effort ca_root_nss || true - # Core CLI tools you asked for - pkg_install_best_effort "${FREEBSD_CORE[@]}" + # Core CLI tools you asked for + pkg_install_best_effort "${FREEBSD_CORE[@]}" - # Extras + dev + utilities - pkg_install_best_effort "${FREEBSD_EXTRA[@]}" - pkg_install_best_effort "${FREEBSD_DEV[@]}" - pkg_install_best_effort "${FREEBSD_UTILS[@]}" + # Extras + dev + utilities + pkg_install_best_effort "${FREEBSD_EXTRA[@]}" + pkg_install_best_effort "${FREEBSD_DEV[@]}" + pkg_install_best_effort "${FREEBSD_UTILS[@]}" - # pass needs gpg + pinentry - pkg_install_best_effort "${FREEBSD_SECURITY[@]}" + # pass needs gpg + pinentry + pkg_install_best_effort "${FREEBSD_SECURITY[@]}" - # Optional stuff from your history where it makes sense - pkg_install_best_effort "${FREEBSD_MISC[@]}" + # Optional stuff from your history where it makes sense + pkg_install_best_effort "${FREEBSD_MISC[@]}" - log "FreeBSD notes:" - cat <<'EOF' + 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 - Build tools often use gmake (GNU make). If you compile from source, try gmake. - GUI apps (kitty/alacritty/slack/chrome) are not installed here by default. EOF - ;; + ;; esac # -------- Post-install notes -------- @@ -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