Skip to content
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

Add sail run command #770

Merged
merged 2 commits into from
Jan 24, 2025
Merged
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
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
Loading