Skip to content

Commit de9ca7e

Browse files
MrFlounderclaude
andcommitted
fix(install): make PATH warning prominent so users don't miss it
After install, users see "command not found" because ~/.local/bin isn't in their current shell's PATH. The previous message buried the required `source` step in generic text. Now shows a visible warning box with the exact command to run, and auto-detects the correct shell profile path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7f9df47 commit de9ca7e

1 file changed

Lines changed: 31 additions & 7 deletions

File tree

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)