Skip to content

Commit d988191

Browse files
xiCO2ktaylorotwell
andauthored
[1.x] Add sail open command. (#551)
* Add `sail open` to open the `APP_URL` on the browser. * Update sail * Update sail --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 304e349 commit d988191

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bin/sail

+13
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function display_help {
9696
echo
9797
echo "${YELLOW}Sharing:${NC}"
9898
echo " ${GREEN}sail share${NC} Share the application publicly via a temporary URL"
99+
echo " ${GREEN}sail open${NC} Open the site in your browser"
99100
echo
100101
echo "${YELLOW}Binaries:${NC}"
101102
echo " ${GREEN}sail bin ...${NC} Run Composer binary scripts from the vendor/bin directory"
@@ -494,6 +495,18 @@ elif [ "$1" == "share" ]; then
494495
sail_is_not_running
495496
fi
496497

498+
# Open the site...
499+
elif [ "$1" == "open" ]; then
500+
shift 1
501+
502+
if [ "$EXEC" == "yes" ]; then
503+
open $APP_URL
504+
505+
exit
506+
else
507+
sail_is_not_running
508+
fi
509+
497510
# Pass unknown commands to the "docker-compose" binary...
498511
else
499512
ARGS+=("$@")

0 commit comments

Comments
 (0)