remove zsh support

This commit is contained in:
2026-06-20 13:54:39 +05:30
parent 85dabd42f1
commit 6415d1d65f
9 changed files with 14 additions and 35 deletions

View File

@@ -149,7 +149,7 @@ main() {
echo
log_success "Bat installation and configuration complete."
log_info "Please close and reopen your terminal or run: source ~/.bashrc (or source ~/.zshrc) to apply changes."
log_info "Please close and reopen your terminal or run: source ~/.bashrc to apply changes."
}
main "$@"

View File

@@ -149,7 +149,7 @@ main() {
log_info "Installed NVM version: $(nvm --version 2>/dev/null || cat "$HOME/.nvm/package.json" | grep '"version":' | head -n1 | sed -E 's/.*"version": "([^"]+)".*/\1/' || echo "unknown")"
else
log_success "Installation complete."
log_info "Please close and reopen your terminal or run: source ~/.bashrc (or source ~/.zshrc) to verify."
log_info "Please close and reopen your terminal or run: source ~/.bashrc to verify."
fi
}

View File

@@ -238,7 +238,7 @@ main() {
log_info "Installed pnpm version: $(pnpm --version 2>/dev/null || echo 'unknown')"
else
log_success "Installation complete."
log_info "Please close and reopen your terminal or run: source ~/.bashrc (or source ~/.zshrc) to verify."
log_info "Please close and reopen your terminal or run: source ~/.bashrc to verify."
fi
}

View File

@@ -102,32 +102,23 @@ configure_shell() {
# Add ~/.local/bin to PATH for the current process
export PATH="$HOME/.local/bin:$PATH"
IFS=' ' read -ra target_files <<< "$(get_shell_configs)"
for config_file in "${target_files[@]}"; do
local shell_name="bash"
if [[ "$config_file" == *".zshrc" ]]; then
shell_name="zsh"
fi
local config_file="$HOME/.bashrc"
if [ -f "$config_file" ]; then
# Ensure ~/.local/bin is in PATH for this file if not already present
if [ -f "$config_file" ] && ! grep -q '\.local/bin' "$config_file" 2>/dev/null; then
if ! grep -q '\.local/bin' "$config_file" 2>/dev/null; then
log_info "Adding ~/.local/bin to PATH in $config_file..."
local path_content='export PATH="$HOME/.local/bin:$PATH"'
inject_block "$config_file" "local-bin path" "$path_content"
fi
log_info "Adding starship initialization to $config_file..."
local content
content="eval \"\$(starship init $shell_name)\""
local content='eval "$(starship init bash)"'
inject_block "$config_file" "starship init" "$content"
# Source if modified (only for bashrc)
if [ "$config_file" = "$HOME/.bashrc" ]; then
. "$config_file" 2>/dev/null || true
fi
done
# Source to apply changes in the current context
. "$config_file" 2>/dev/null || true
fi
}
main() {

View File

@@ -66,14 +66,8 @@ configure_shell() {
IFS=' ' read -ra target_files <<< "$(get_shell_configs)"
for config_file in "${target_files[@]}"; do
local shell_name="bash"
if [[ "$config_file" == *".zshrc" ]]; then
shell_name="zsh"
fi
log_info "Adding zoxide initialization to $config_file..."
local content
content="eval \"\$(zoxide init --cmd cd $shell_name)\""
local content="eval \"\$(zoxide init --cmd cd bash)\""
inject_block "$config_file" "zoxide init" "$content"