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

added a new ENVIRONMENT_FILE variable #371

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 10 additions & 2 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ else
fi

# Source the ".env" file so Laravel's environment variables are available...
if [ -f ./.env ]; then
source ./.env
ENVIRONMENT_FILE=${ENVIRONMENT_FILE:-"./.env"}
ENVIRONMENT_PRESENT="no"
if [ -f $ENVIRONMENT_FILE ]; then
ENVIRONMENT_PRESENT="yes"
source $ENVIRONMENT_FILE
fi

# Define environment variables...
Expand Down Expand Up @@ -144,6 +147,11 @@ else
DOCKER_COMPOSE=(docker compose)
fi

# Define Docker Environment
if [ "$ENVIRONMENT_PRESENT" == "yes" ]; then
DOCKER_COMPOSE+=(--env-file "$ENVIRONMENT_FILE")
fi

if [ -n "$SAIL_FILES" ]; then
# Convert SAIL_FILES to an array...
SAIL_FILES=("${SAIL_FILES//:/ }")
Expand Down