laravel / sail

Docker files for running a basic Laravel application.
https://laravel.com/docs/sail
MIT License
1.68k stars 475 forks source link

sail open - "command not found" #743

Closed rqpt closed 5 days ago

rqpt commented 6 days ago

Sail Version

1.26

Laravel Version

11.30.0

PHP Version

8.3.11

Operating System

Linux

OS Version

Alpine Edge

Description

The sail open command does not work, due to a mysterious dependency on some url open utility that might or might not even exist. Said utility is simply called ... "open" 👀

The offending code is at the veeeeeery bottom of the sail script: (line 560 at the time of writing)

# Open the site...
elif [ "$1" == "open" ]; then
    shift 1

    if [ "$EXEC" == "yes" ]; then

        if [[ -n "$APP_PORT" && "$APP_PORT" != "80" ]]; then
            FULL_URL="${APP_URL}:${APP_PORT}"
        else
            FULL_URL="$APP_URL"
        fi

        open "$FULL_URL"

        exit
    else
        sail_is_not_running
    fi
fi

What is this 'open' executable? I don't have it, and haven't heard of it? It isn't in my package manager. Doubt.

EDIT: It seems open is in fact a thing, lol... just not on linux 😿

I'll try to submit a fix for this hopefully soon, but if someone takes this before me - I think an xdg-open should do.

Steps To Reproduce

  1. Init a new laravel app with sail.
  2. Run sail open
  3. Beyold the mysterious error message: /vendor/laravel/sail/bin/sail: line 572: open: command not found
devajmeireles commented 6 days ago

Why not submit your code snipped as a PR to fix that instead of only opening an issue?

rqpt commented 6 days ago

Why not submit your code snipped as a PR to fix that instead of only opening an issue?

I was going to, but life happens and your attention is needed elsewhere sometimes.

Also, did you read my closing paragraph? I don't have a fix for this yet. I noticed it's broken and intend to fix it, just not this very second.