Skip to content

Commit 22cd4e5

Browse files
MrFlounderclaude
andauthored
fix(install): make PATH warning prominent after install (#56)
## Summary - After install, users see `crab: command not found` because `~/.local/bin` isn't in their current shell's PATH - The previous post-install message buried the required `source ~/.zshrc` step in generic text that was easy to miss - Now shows a visible warning box with the exact shell profile to source, auto-detected for zsh/bash/other shells - Skips the warning entirely if PATH is already configured (e.g. re-install) ## Test plan - [ ] Run `install.sh` in a clean environment where `~/.local/bin` is not in PATH — verify the yellow warning box appears with the correct profile path - [ ] Run `install.sh` where `~/.local/bin` is already in PATH — verify no warning box, just "Get started:" - [ ] Test on both zsh and bash shells to confirm correct profile detection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1c21b02 commit 22cd4e5

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

install.sh

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,35 @@ echo ' ( •_•) Installation complete!'
208208
echo -e " /)${GREEN}🦀${NC}(\\"
209209
echo ' < >'
210210
echo ""
211-
echo "You can use either 'crabcode' or 'crab' command."
212-
echo ""
213-
echo "Next steps:"
214-
echo " 1. Run 'source ~/.zshrc' (or open new terminal)"
215-
echo " 2. Run 'crab init' to create your config"
216-
echo " 3. Run 'crab ws 1' to start your first workspace"
211+
212+
# Determine if PATH needs reloading and which profile to source
213+
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
214+
# Figure out the right profile file for the message
215+
case "$SHELL" in
216+
*/zsh) _profile="$HOME/.zshrc" ;;
217+
*/bash)
218+
if [[ -f "$HOME/.bash_profile" ]]; then
219+
_profile="$HOME/.bash_profile"
220+
else
221+
_profile="$HOME/.bashrc"
222+
fi
223+
;;
224+
*) _profile="$HOME/.profile" ;;
225+
esac
226+
227+
echo -e "${YELLOW}┌─────────────────────────────────────────────────┐${NC}"
228+
echo -e "${YELLOW}│ ⚠ Run this command before using crab: │${NC}"
229+
echo -e "${YELLOW}│ │${NC}"
230+
echo -e "${YELLOW}│ source $_profile${NC}"
231+
echo -e "${YELLOW}│ │${NC}"
232+
echo -e "${YELLOW}│ Or just open a new terminal window. │${NC}"
233+
echo -e "${YELLOW}└─────────────────────────────────────────────────┘${NC}"
234+
echo ""
235+
echo "Then get started:"
236+
else
237+
echo "Get started:"
238+
fi
239+
echo " crab init # create your config"
240+
echo " crab ws 1 # start your first workspace"
241+
echo " crab cheat # quick reference"
217242
echo ""
218-
echo "Run 'crab cheat' for a quick reference."

0 commit comments

Comments
 (0)