Skip to content
Snippets Groups Projects
Commit 72a3dc6b authored by Gunnar Schaefer's avatar Gunnar Schaefer
Browse files

Saner way to achieve env var precedence

parent cd8e3454
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,12 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
echo() { builtin echo "[SCITRAN] $@"; }
if [ "$#" -eq 1 ]; then
TEMP_ENV_FILE=$(mktemp -t scitran_env)
env > $TEMP_ENV_FILE
EXISTING_ENV=$(env | grep "SCITRAN_" | cat)
set -o allexport
source "$1"
source $TEMP_ENV_FILE
rm -f $TEMP_ENV_FILE
eval "$EXISTING_ENV"
set +o allexport
fi
if [ "$#" -gt 1 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment