Skip to content

[1.x] Add suggestion to configure Sail shell alias in display_help for easier command usage #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ if test -t 1; then
BOLD="$(tput bold)"
YELLOW="$(tput setaf 3)"
GREEN="$(tput setaf 2)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
NC="$(tput sgr0)"
fi
fi
Expand All @@ -37,6 +39,18 @@ function display_help {
echo
echo "Unknown commands are passed to the docker-compose binary."
echo
if ! grep -q "alias sail=" ~/.bashrc ~/.zshrc 2>/dev/null; then
echo "${YELLOW}Configuring A Shell Alias:${NC}"
echo "However, instead of repeatedly typing ./bin/sail to execute Sail commands,"
echo "you may wish to configure a shell alias that allows you to execute Sail's commands more easily:"
echo
echo "${BOLD}${MAGENTA}alias ${YELLOW}sail${MAGENTA}=${CYAN}'bash \$([ -f sail ] && echo sail || echo bin/sail)'${NC}"
echo
echo "To make sure this is always available,"
echo "you may add this to your shell configuration file in your home directory,"
echo "such as ${YELLOW}${BOLD}~/.zshrc${NC} or ${YELLOW}${BOLD}~/.bashrc${NC}, and then restart your shell."
echo
fi
echo "${YELLOW}docker-compose Commands:${NC}"
echo " ${GREEN}sail up${NC} Start the application"
echo " ${GREEN}sail up -d${NC} Start the application in the background"
Expand Down