Skip to content

Commit

Permalink
Replaced user sail with unused env WWWUSER (#1)
Browse files Browse the repository at this point in the history
* Fix bug where `sail root-shell` did not open a shell as root

* Replaced user `sail` with unused env `WWWUSER`

---------

Co-authored-by: Caleb White <[email protected]>
  • Loading branch information
calebdw and Caleb White authored Dec 14, 2023
1 parent 15ec4be commit e2e2186
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ if [ "$1" == "php" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" "php" "$@")
else
Expand All @@ -222,7 +222,7 @@ elif [ "$1" == "bin" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" ./vendor/bin/"$@")
else
Expand All @@ -234,7 +234,7 @@ elif [ "$1" == "docker-compose" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" "${DOCKER_COMPOSE[@]}")
else
Expand All @@ -246,7 +246,7 @@ elif [ "$1" == "composer" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" "composer" "$@")
else
Expand All @@ -258,7 +258,7 @@ elif [ "$1" == "artisan" ] || [ "$1" == "art" ] || [ "$1" == "a" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php artisan "$@")
else
Expand All @@ -270,7 +270,7 @@ elif [ "$1" == "debug" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail -e XDEBUG_SESSION=1)
ARGS+=(exec -u "${WWWUSER}" -e XDEBUG_SESSION=1)
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php artisan "$@")
else
Expand All @@ -282,7 +282,7 @@ elif [ "$1" == "test" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php artisan test "$@")
else
Expand All @@ -294,7 +294,7 @@ elif [ "$1" == "phpunit" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php vendor/bin/phpunit "$@")
else
Expand All @@ -306,7 +306,7 @@ elif [ "$1" == "pest" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php vendor/bin/pest "$@")
else
Expand All @@ -318,7 +318,7 @@ elif [ "$1" == "pint" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php vendor/bin/pint "$@")
else
Expand All @@ -330,7 +330,7 @@ elif [ "$1" == "dusk" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=(-e "APP_URL=http://${APP_SERVICE}")
ARGS+=(-e "DUSK_DRIVER_URL=http://selenium:4444/wd/hub")
Expand All @@ -344,7 +344,7 @@ elif [ "$1" == "dusk:fails" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=(-e "APP_URL=http://${APP_SERVICE}")
ARGS+=(-e "DUSK_DRIVER_URL=http://selenium:4444/wd/hub")
Expand All @@ -358,7 +358,7 @@ elif [ "$1" == "tinker" ] ; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" php artisan tinker)
else
Expand All @@ -370,7 +370,7 @@ elif [ "$1" == "node" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" node "$@")
else
Expand All @@ -382,7 +382,7 @@ elif [ "$1" == "npm" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" npm "$@")
else
Expand All @@ -394,7 +394,7 @@ elif [ "$1" == "npx" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" npx "$@")
else
Expand All @@ -406,7 +406,7 @@ elif [ "$1" == "pnpm" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" pnpm "$@")
else
Expand All @@ -418,7 +418,7 @@ elif [ "$1" == "pnpx" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" pnpx "$@")
else
Expand All @@ -430,7 +430,7 @@ elif [ "$1" == "yarn" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" yarn "$@")
else
Expand All @@ -442,7 +442,7 @@ elif [ "$1" == "bun" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" bun "$@")
else
Expand All @@ -454,7 +454,7 @@ elif [ "$1" == "bunx" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" bunx "$@")
else
Expand Down Expand Up @@ -505,7 +505,7 @@ elif [ "$1" == "shell" ] || [ "$1" == "bash" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
ARGS+=(exec -u "${WWWUSER}")
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" bash "$@")
else
Expand Down

0 comments on commit e2e2186

Please sign in to comment.