Commit ecf52786 authored by Kenneth Reitz's avatar Kenneth Reitz

extract utils

parent 863abfb0
......@@ -66,41 +66,7 @@ unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
# We'll need to send these statics to other scripts we `source`.
export PIP_DOWNLOAD_CACHE BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
# Syntax sugar.
indent() {
RE="s/^/ /"
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE"
}
# Clean up pip output
cleanup() {
sed -e 's/\.\.\.\+/.../g' | sed -e '/already satisfied/Id' | sed -e '/Overwriting/Id' | sed -e '/python executable/Id' | sed -e '/no previously-included files/Id'
}
# Virtualenv wrapper.
function virtualenv (){
python "$ROOT_DIR/vendor/virtualenv-1.8.4/virtualenv.py" "$@"
}
# Buildpack Steps.
function puts-step (){
echo "-----> $@"
}
# Buildpack Warnings.
function puts-warn (){
echo " ! $@"
}
# Usage: $ set-env key value
function set-env (){
echo "export $1=$2" >> $PROFILE_PATH
}
# Usage: $ set-default-env key value
function set-default-env (){
echo "export $1=\${$1:-$2}" >> $PROFILE_PATH
}
source $BIN_DIR/utils
# ## Build Time
#
......
......@@ -61,4 +61,4 @@ IFS_BAK=
SETTINGS_FILE=$(find $BUILD_DIR/. -maxdepth 2 -type f -name 'settings.py' | head -1)
[ -n "$SETTINGS_FILE" ] && ( list_requirements $BUILD_DIR/requirements.txt | grep -Fiq "django" ) && echo Python/Django || echo Python
\ No newline at end of file
[ -n "$SETTINGS_FILE" ] && ( list_requirements $BUILD_DIR/requirements.txt | grep -Fiq "django" ) && echo Python/Django || echo Python
# Syntax sugar.
indent() {
RE="s/^/ /"
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE"
}
# Clean up pip output
cleanup() {
sed -e 's/\.\.\.\+/.../g' | sed -e '/already satisfied/Id' | sed -e '/Overwriting/Id' | sed -e '/python executable/Id' | sed -e '/no previously-included files/Id'
}
# Virtualenv wrapper.
function virtualenv (){
python "$ROOT_DIR/vendor/virtualenv-1.8.4/virtualenv.py" "$@"
}
# Buildpack Steps.
function puts-step (){
echo "-----> $@"
}
# Buildpack Warnings.
function puts-warn (){
echo " ! $@"
}
# Usage: $ set-env key value
function set-env (){
echo "export $1=$2" >> $PROFILE_PATH
}
# Usage: $ set-default-env key value
function set-default-env (){
echo "export $1=\${$1:-$2}" >> $PROFILE_PATH
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment