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]}" )/.." ...@@ -7,13 +7,12 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
echo() { builtin echo "[SCITRAN] $@"; } echo() { builtin echo "[SCITRAN] $@"; }
if [ "$#" -eq 1 ]; then if [ "$#" -eq 1 ]; then
TEMP_ENV_FILE=$(mktemp -t scitran_env) EXISTING_ENV=$(env | grep "SCITRAN_" | cat)
env > $TEMP_ENV_FILE
set -o allexport set -o allexport
source "$1" source "$1"
source $TEMP_ENV_FILE eval "$EXISTING_ENV"
rm -f $TEMP_ENV_FILE
set +o allexport set +o allexport
fi fi
if [ "$#" -gt 1 ]; then 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