From 4571031c0b055242ba69a269dd6832f39ac3b284 Mon Sep 17 00:00:00 2001 From: muava12 Date: Wed, 25 Feb 2026 03:03:11 +0800 Subject: [PATCH] fix(installer): add shell config reload and zsh support [skip ci] --- install_picoclaw.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install_picoclaw.sh b/install_picoclaw.sh index 1e4013393..2dc7c7f54 100644 --- a/install_picoclaw.sh +++ b/install_picoclaw.sh @@ -131,12 +131,29 @@ if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then else print_success "Already configured in ~/.bashrc" fi + # Also add to ~/.zshrc if zsh is available + if [ -f "$HOME/.zshrc" ] && ! grep -q "$INSTALL_DIR" ~/.zshrc 2>/dev/null; then + echo '' >> ~/.zshrc + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc + print_success "Added to ~/.zshrc" + fi export PATH="$INSTALL_DIR:$PATH" print_success "PATH updated for current session" else print_success "Already in PATH" fi +# Reload shell config so picoclaw is immediately available +print_step "Reloading shell config..." +if [ -n "$BASH_VERSION" ] && [ -f "$HOME/.bashrc" ]; then + source "$HOME/.bashrc" +elif [ -n "$ZSH_VERSION" ] && [ -f "$HOME/.zshrc" ]; then + source "$HOME/.zshrc" +elif [ -f "$HOME/.bashrc" ]; then + source "$HOME/.bashrc" +fi +print_success "Done" + echo "" echo -e "Run: ${BOLD}picoclaw onboard${RESET} to get started" echo ""