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 lando support #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 11 additions & 11 deletions artisan.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ function artisan() {
local docker_compose_config_path=`find $laravel_path -maxdepth 1 \( -name "docker-compose.yml" -o -name "docker-compose.yaml" \) | head -n1`
local artisan_cmd

if [ "$docker_compose_config_path" = '' ]; then
if [ -f "$laravel_path/.lando.yml" ]; then
artisan_cmd="lando artisan"
elif [ "`grep "laravel/sail" $docker_compose_config_path | head -n1`" != '' ]; then
artisan_cmd="$laravel_path/vendor/bin/sail artisan"
elif [ "$docker_compose_config_path" = '' ]; then
artisan_cmd="php $artisan_path"
else
if [ "`grep "laravel/sail" $docker_compose_config_path | head -n1`" != '' ]; then
artisan_cmd="$laravel_path/vendor/bin/sail artisan"
local docker_compose_cmd=`_docker_compose_cmd`
local docker_compose_service_name=`$docker_compose_cmd ps --services 2>/dev/null | grep 'app\|php\|api\|workspace\|laravel\.test\|webhost' | head -n1`
if [ -t 1 ]; then
artisan_cmd="$docker_compose_cmd exec $docker_compose_service_name php artisan"
else
local docker_compose_cmd=`_docker_compose_cmd`
local docker_compose_service_name=`$docker_compose_cmd ps --services 2>/dev/null | grep 'app\|php\|api\|workspace\|laravel\.test\|webhost' | head -n1`
if [ -t 1 ]; then
artisan_cmd="$docker_compose_cmd exec $docker_compose_service_name php artisan"
else
# The command is not being run in a TTY (e.g. it's being called by the completion handler below)
artisan_cmd="$docker_compose_cmd exec -T $docker_compose_service_name php artisan"
fi
# The command is not being run in a TTY (e.g. it's being called by the completion handler below)
artisan_cmd="$docker_compose_cmd exec -T $docker_compose_service_name php artisan"
fi
fi

Expand Down