Tailoring: wire starship into .bashrc only when dotfiles are absent
Per YuKu: after the starship install, append export STARSHIP_CONFIG=$HOME/.config/starship.toml eval "$(starship init bash)" to ~/.bashrc — but ONLY when fedora-dots was NOT cloned (on dots machines .bashrc belongs to the dots). Also gated on starship actually being present (no dead eval in every shell) and idempotent (grep guard). Harness: appended once with dots=no, never with dots=yes (clean-home re-test; the first test was invalid because rm -rf home/* left the previous .bashrc — the known dotfile-cleanup pitfall), and not duplicated on re-run.
This commit is contained in:
@@ -606,6 +606,22 @@ if command -v starship >/dev/null 2>&1 && [[ ! -f "$HOME/.config/starship.toml"
|
||||
starship preset tokyo-night -o "$HOME/.config/starship.toml" \
|
||||
|| warn "Could not apply the preset (starship still installed)."
|
||||
fi
|
||||
|
||||
# bashrc wiring — ONLY when dotfiles were not cloned: on machines that
|
||||
# use fedora-dots, .bashrc is owned by the dots and must not be edited
|
||||
# here. Also requires starship to actually be present (a missing binary
|
||||
# would make every shell print an error from the eval line).
|
||||
if [[ "$DOTFILES" != "true" ]] \
|
||||
&& command -v starship >/dev/null 2>&1 \
|
||||
&& ! grep -q "starship init" "$HOME/.bashrc" 2>/dev/null; then
|
||||
info "Wiring starship into ~/.bashrc..."
|
||||
cat >> "$HOME/.bashrc" <<'EOF'
|
||||
|
||||
# starship
|
||||
export STARSHIP_CONFIG="$HOME/.config/starship.toml"
|
||||
eval "$(starship init bash)"
|
||||
EOF
|
||||
fi
|
||||
pause_if_debug
|
||||
|
||||
# --- 8.3 RobotoMono Nerd Font (the modules install JetBrainsMono) ---
|
||||
|
||||
Reference in New Issue
Block a user