[bin] Cleaning up bootstrap and setup scripts
This commit is contained in:
@ -98,7 +98,7 @@ esac
|
|||||||
# -------- Clone/update dotfiles --------
|
# -------- Clone/update dotfiles --------
|
||||||
if [[ -d "$DOTFILES_DIR/.git" ]]; then
|
if [[ -d "$DOTFILES_DIR/.git" ]]; then
|
||||||
log "Updating dotfiles in $DOTFILES_DIR..."
|
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
|
else
|
||||||
log "Cloning dotfiles to $DOTFILES_DIR..."
|
log "Cloning dotfiles to $DOTFILES_DIR..."
|
||||||
git clone "$DOTFILES_REPO" "$DOTFILES_DIR"
|
git clone "$DOTFILES_REPO" "$DOTFILES_DIR"
|
||||||
@ -129,32 +129,18 @@ else
|
|||||||
git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$OMZ_DIR"
|
git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$OMZ_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# -------- Doom Emacs --------
|
# -------- Set zsh as default shell --------
|
||||||
if [[ -d "$DOOM_DIR/.git" ]]; then
|
log "Setting zsh as default shell..."
|
||||||
log "Doom Emacs already present at $DOOM_DIR (updating)..."
|
ZSH_PATH="$(command -v zsh)"
|
||||||
git -C "$DOOM_DIR" pull --rebase || true
|
case "$PLATFORM" in
|
||||||
elif [[ -e "$DOOM_DIR" ]]; then
|
macos)
|
||||||
log "Skipping Doom Emacs clone because $DOOM_DIR exists but is not a git repo."
|
sudo -u "$USER" chsh -s "$ZSH_PATH" || chsh -s "$ZSH_PATH"
|
||||||
log "Move it aside if you want to install Doom there."
|
;;
|
||||||
else
|
*)
|
||||||
log "Cloning Doom Emacs to $DOOM_DIR..."
|
sudo chsh -s "$ZSH_PATH" "$USER" || sudo usermod -s "$ZSH_PATH" "$USER" || chsh -s "$ZSH_PATH"
|
||||||
git clone --depth=1 https://github.com/doomemacs/doomemacs "$DOOM_DIR"
|
;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
# -------- Next steps --------
|
log "Please open a new shell or terminal so your shell config reloads."
|
||||||
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 "Done."
|
log "Done."
|
||||||
|
|||||||
@ -251,6 +251,9 @@ fedora)
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install_opencode
|
install_opencode
|
||||||
|
|
||||||
|
log "Final system upgrade..."
|
||||||
|
sudo dnf -y upgrade
|
||||||
;;
|
;;
|
||||||
|
|
||||||
arch)
|
arch)
|
||||||
@ -265,6 +268,9 @@ arch)
|
|||||||
|
|
||||||
aur_install_if_possible google-chrome slack-desktop || true
|
aur_install_if_possible google-chrome slack-desktop || true
|
||||||
|
|
||||||
|
log "Final system upgrade..."
|
||||||
|
sudo pacman -Syu --noconfirm
|
||||||
|
|
||||||
install_opencode
|
install_opencode
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -284,6 +290,9 @@ macos)
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install_opencode
|
install_opencode
|
||||||
|
|
||||||
|
log "Final system upgrade..."
|
||||||
|
brew upgrade
|
||||||
;;
|
;;
|
||||||
|
|
||||||
freebsd)
|
freebsd)
|
||||||
@ -307,6 +316,9 @@ freebsd)
|
|||||||
# Optional stuff from your history where it makes sense
|
# Optional stuff from your history where it makes sense
|
||||||
pkg_install_best_effort "${FREEBSD_MISC[@]}"
|
pkg_install_best_effort "${FREEBSD_MISC[@]}"
|
||||||
|
|
||||||
|
log "Final system upgrade..."
|
||||||
|
sudo pkg upgrade -y
|
||||||
|
|
||||||
log "FreeBSD notes:"
|
log "FreeBSD notes:"
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
- 'pass' is installed as 'password-store' on FreeBSD; command is still: pass
|
- 'pass' is installed as 'password-store' on FreeBSD; command is still: pass
|
||||||
@ -333,3 +345,21 @@ cat <<'EOF'
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
log "Done."
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user