simple check/add

This commit is contained in:
Jonas H
2026-03-07 22:24:09 +01:00
parent 9106effa00
commit a4d518826c

View File

@@ -138,6 +138,26 @@ else
echo "JetBrains Mono Nerd Font already installed, skipping." echo "JetBrains Mono Nerd Font already installed, skipping."
fi fi
# ---------------------------------------------------------------------------
# Configure shell
# ---------------------------------------------------------------------------
echo ""
echo "Configuring zsh..."
# Ensure .zshrc exists
if [[ ! -f "$HOME/.zshrc" ]]; then
touch "$HOME/.zshrc"
fi
# Ensure starship is initialized in .zshrc
if ! grep -q 'eval "$(starship init zsh)"' "$HOME/.zshrc"; then
echo 'eval "$(starship init zsh)"' >> "$HOME/.zshrc"
echo " Added starship initialization to ~/.zshrc"
else
echo " Starship already configured in ~/.zshrc"
fi
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Stow all packages # Stow all packages
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -184,24 +204,4 @@ for PACKAGE in "$DOTFILES_DIR"/*/; do
stow --dir="$DOTFILES_DIR" --target="$HOME" --restow "$PACKAGE" stow --dir="$DOTFILES_DIR" --target="$HOME" --restow "$PACKAGE"
done done
# ---------------------------------------------------------------------------
# Configure shell
# ---------------------------------------------------------------------------
echo ""
echo "Configuring zsh..."
# Ensure .zshrc exists
if [[ ! -f "$HOME/.zshrc" ]]; then
touch "$HOME/.zshrc"
fi
# Ensure starship is initialized in .zshrc
if ! grep -q 'eval "$(starship init zsh)"' "$HOME/.zshrc"; then
echo 'eval "$(starship init zsh)"' >> "$HOME/.zshrc"
echo " Added starship initialization to ~/.zshrc"
else
echo " Starship already configured in ~/.zshrc"
fi
echo "Done." echo "Done."