-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.env.sh
More file actions
23 lines (17 loc) · 843 Bytes
/
.env.sh
File metadata and controls
23 lines (17 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ENVFILE="${ENVFILE:-.env}"
if [[ -f "${DIR}/${ENVFILE}" ]]; then
# https://unix.stackexchange.com/a/79065
eval "$(/bin/bash "${DIR}/bash/exportsource.sh" "${DIR}/${ENVFILE}")"
fi
source "${DIR}/bash/require_non_empty_var.sh"
# -----------------------------------------------------------------------------
# Validation
# -----------------------------------------------------------------------------
require_non_empty_and_matching_var "${0}" "NODE_API_PORT" "^[0-9]+$"
require_non_empty_and_matching_var "${0}" "NODE_API_PORT_HTTPS" "^[0-9]+$"
require_non_empty_var "${0}" "LOCAL_HOSTS"
require_non_empty_var "${0}" "FLAG"
require_non_empty_var "${0}" "PROD_SCHEMA"
require_non_empty_var "${0}" "PROD_HOSTNAME"
require_non_empty_and_matching_var "${0}" "PROD_PORT" "^[0-9]+$"