Skip to content

Commit fe1a4ad

Browse files
rojtjotaylorotwell
andauthored
Add sail run command (#770)
* Add `sail run` command * Update sail --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent a910e2d commit fe1a4ad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bin/sail

+15
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ function display_help {
112112
echo
113113
echo "${YELLOW}Binaries:${NC}"
114114
echo " ${GREEN}sail bin ...${NC} Run Composer binary scripts from the vendor/bin directory"
115+
echo " ${GREEN}sail run ...${NC} Run a command within the application container"
115116
echo
116117
echo "${YELLOW}Customization:${NC}"
117118
echo " ${GREEN}sail artisan sail:publish${NC} Publish the Sail configuration files"
@@ -233,6 +234,20 @@ elif [ "$1" == "bin" ]; then
233234
sail_is_not_running
234235
fi
235236

237+
# Proxy commands on the application container...
238+
elif [ "$1" == "run" ]; then
239+
shift 1
240+
241+
if [ "$EXEC" == "yes" ]; then
242+
CMD=$1
243+
shift 1
244+
ARGS+=(exec -u sail)
245+
[ ! -t 0 ] && ARGS+=(-T)
246+
ARGS+=("$APP_SERVICE" "$CMD")
247+
else
248+
sail_is_not_running
249+
fi
250+
236251
# Proxy docker-compose commands to the docker-compose binary on the application container...
237252
elif [ "$1" == "docker-compose" ]; then
238253
shift 1

0 commit comments

Comments
 (0)