run should forward env vars only if they're defined

This commit is contained in:
Michael Bradley, Jr 2018-08-20 17:51:34 -05:00
parent 08bd3291f5
commit 5b9a0d27a5
1 changed files with 16 additions and 2 deletions

18
run.sh
View File

@ -35,10 +35,24 @@ run_embark () {
"30303:30303"
"-v"
"${EMBARK_DOCKER_MOUNT_SOURCE}:${EMBARK_DOCKER_MOUNT_TARGET}"
"-e"
"TERM"
)
if [[ -v LANG ]]; then
run_opts=( "${run_opts[@]}" "-e" "LANG" )
fi
if [[ -v LANGUAGE ]]; then
run_opts=( "${run_opts[@]}" "-e" "LANGUAGE" )
fi
if [[ -v LC_ALL ]]; then
run_opts=( "${run_opts[@]}" "-e" "LC_ALL" )
fi
if [[ -v TERM ]]; then
run_opts=( "${run_opts[@]}" "-e" "TERM" )
fi
if [[ $EMBARK_DOCKER_RUN_RM = true ]]; then
run_opts=( "${run_opts[@]}" "--rm" )
fi