Skip to content
Snippets Groups Projects
Commit 566f7f45 authored by Kenneth Reitz's avatar Kenneth Reitz
Browse files

new buildpack env standard

parent 4ff62b2b
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ BIN_DIR=$(cd $(dirname $0); pwd) # absolute path ...@@ -15,7 +15,7 @@ BIN_DIR=$(cd $(dirname $0); pwd) # absolute path
ROOT_DIR=$(dirname $BIN_DIR) ROOT_DIR=$(dirname $BIN_DIR)
BUILD_DIR=$1 BUILD_DIR=$1
CACHE_DIR=$2 CACHE_DIR=$2
ENV_FILE=$3 ENV_DIR=$3
CACHED_DIRS=".heroku" CACHED_DIRS=".heroku"
......
...@@ -59,10 +59,22 @@ function deep-rm (){ ...@@ -59,10 +59,22 @@ function deep-rm (){
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \; find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
} }
function sub-env (){
if [[ -f $ENV_FILE ]]; then sub-env() {
(export $(egrep -v '^(GIT_DIR|PYTHONHOME|PYTHONPATH|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)' -f $ENV_FILE); $1)
else WHITELIST=${2:-''}
BLACKLIST=${3:-'^(GIT_DIR|PYTHONHOME|PYTHONPATH|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)$'}
(
if [ -d "$ENV_DIR" ]; then
for e in $(ls $ENV_DIR); do
echo "$e" | grep -E "$WHITELIST" | grep -qvE "$BLACKLIST" &&
export "$e=$(cat $ENV_DIR/$e)"
:
done
fi
$1 $1
fi
} )
}
\ No newline at end of file
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