2023-10-31 10:35:14 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script has been created as part of the Blueprint source code
|
2024-01-15 11:40:50 -05:00
|
|
|
# and uses the same license as the rest of the codebase.
|
2023-11-01 08:43:23 -04:00
|
|
|
#
|
|
|
|
# Commands:
|
|
|
|
# - grabAppUrl string
|
|
|
|
# - grabAppDebug bool
|
|
|
|
# - grabAppTimezone string
|
|
|
|
# - grabAppLocale string
|
|
|
|
|
|
|
|
|
2023-10-31 10:35:14 -04:00
|
|
|
|
2023-12-17 07:43:59 -05:00
|
|
|
cd "${BLUEPRINT__FOLDER}" || exit
|
2023-11-08 11:34:32 -05:00
|
|
|
env_file=".env"
|
|
|
|
while IFS= read -r line; do
|
|
|
|
if [[ $line == \#* ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [[ $line == *"="* ]]; then
|
|
|
|
variable_name=$(echo "$line" | cut -d= -f1)
|
|
|
|
variable_value=$(echo "$line" | cut -d= -f2-)
|
|
|
|
variable_name=$(echo "$variable_name" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
|
|
variable_value=$(echo "$variable_value" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed 's/^"\(.*\)"$/\1/')
|
|
|
|
declare "$variable_name=$variable_value"
|
|
|
|
fi
|
|
|
|
done < "$env_file"
|
2023-10-31 10:35:14 -04:00
|
|
|
|
2023-12-17 07:43:59 -05:00
|
|
|
grabAppUrl() { echo "$APP_URL"; }
|
|
|
|
grabAppDebug() { echo "$APP_DEBUG"; }
|
|
|
|
grabAppTimezone() { echo "$APP_TIMEZONE"; }
|
|
|
|
grabAppLocale() { echo "$APP_LOCALE"; }
|