fix(installer): add shell config reload and zsh support [skip ci]

This commit is contained in:
muava12 2026-02-25 03:03:11 +08:00
parent ae696ade12
commit 4571031c0b

View file

@ -131,12 +131,29 @@ if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
else else
print_success "Already configured in ~/.bashrc" print_success "Already configured in ~/.bashrc"
fi 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" export PATH="$INSTALL_DIR:$PATH"
print_success "PATH updated for current session" print_success "PATH updated for current session"
else else
print_success "Already in PATH" print_success "Already in PATH"
fi 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 ""
echo -e "Run: ${BOLD}picoclaw onboard${RESET} to get started" echo -e "Run: ${BOLD}picoclaw onboard${RESET} to get started"
echo "" echo ""