Skip to content

Commit

Permalink
Warn if DATA_DIR is already set
Browse files Browse the repository at this point in the history
If the variable DATA_DIR is already set the declaration of it via .env may be
ignored.

Resolves pelias#93.
  • Loading branch information
dr0i authored and lod committed Apr 23, 2019
1 parent 140652e commit 19e9834
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function env_load_stream(){
# ensure locale is correctly set?
# export LC_ALL=en_US.UTF-8

# warn if DATA_DIR is already set
[[ -n $DATA_DIR ]] && printf "DATA_DIR is already set to '$DATA_DIR' - this may cause the DATA_DIR specified in the .env to be ignored\n"
# load DATA_DIR and other vars from docker-compose .env file
# note: strips comments and empty lines
[ -f .env ] && env_load_stream < <(grep -v '^$\|^\s*$\#' .env)
Expand Down

0 comments on commit 19e9834

Please sign in to comment.