mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-26 01:08:57 +00:00
Add Shopware 6 example (#61)
This commit is contained in:
39
shopware6/bin/functions.sh
Normal file
39
shopware6/bin/functions.sh
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
load_dotenv() {
|
||||
LOAD_DOTENV=${LOAD_DOTENV:-"1"}
|
||||
|
||||
if [[ "$LOAD_DOTENV" == "0" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
CURRENT_ENV=${APP_ENV:-"dev"}
|
||||
env_file="$1"
|
||||
|
||||
# If we have an actual .env file load it
|
||||
if [[ -e "$env_file" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_file"
|
||||
elif [[ -e "$env_file.dist" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_file.dist"
|
||||
fi
|
||||
|
||||
# If we have an local env file load it
|
||||
if [[ -e "$env_file.local" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_file.local"
|
||||
fi
|
||||
|
||||
# If we have an env file for the current env load it
|
||||
if [[ -e "$env_file.$CURRENT_ENV" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_file.$CURRENT_ENV"
|
||||
fi
|
||||
|
||||
# If we have an env file for the current env load it'
|
||||
if [[ -e "$env_file.$CURRENT_ENV.local" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_file.$CURRENT_ENV.local"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user