Skip to content

Commit

Permalink
Add sail run command (#770)
Browse files Browse the repository at this point in the history
* Add `sail run` command

* Update sail

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
rojtjo and taylorotwell authored Jan 24, 2025
1 parent a910e2d commit fe1a4ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function display_help {
echo
echo "${YELLOW}Binaries:${NC}"
echo " ${GREEN}sail bin ...${NC} Run Composer binary scripts from the vendor/bin directory"
echo " ${GREEN}sail run ...${NC} Run a command within the application container"
echo
echo "${YELLOW}Customization:${NC}"
echo " ${GREEN}sail artisan sail:publish${NC} Publish the Sail configuration files"
Expand Down Expand Up @@ -233,6 +234,20 @@ elif [ "$1" == "bin" ]; then
sail_is_not_running
fi

# Proxy commands on the application container...
elif [ "$1" == "run" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
CMD=$1
shift 1
ARGS+=(exec -u sail)
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" "$CMD")
else
sail_is_not_running
fi

# Proxy docker-compose commands to the docker-compose binary on the application container...
elif [ "$1" == "docker-compose" ]; then
shift 1
Expand Down

0 comments on commit fe1a4ad

Please sign in to comment.