Skip to content

Commit

Permalink
Change environment variable name to PROJECT_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
timanovsky committed Jun 16, 2017
1 parent f27f872 commit ac9b773
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,30 @@
BUILD_DIR=${1:-}
CACHE_DIR=${2:-}
ENV_DIR=${3:-}
BP_DIR=$(cd $(dirname ${0:-}); cd ..; pwd)

echo "BUILD_DIR: $BUILD_DIR"
echo "CACHE_DIR: $CACHE_DIR"
echo "ENV_DIR: $ENV_DIR"
# echo "BP_DIR: $BP_DIR"
# ls $ENV_DIR

if [ -f $ENV_DIR/BUILDPACK_PATH ]; then
BUILDPACK_PATH=`cat $ENV_DIR/BUILDPACK_PATH`
if [ -d $BUILD_DIR/$BUILDPACK_PATH ]; then
echo "-----> Subdir buildpack in $BUILDPACK_PATH"
if [ -f $ENV_DIR/PROJECT_PATH ]; then
PROJECT_PATH=`cat $ENV_DIR/PROJECT_PATH`
if [ -d $BUILD_DIR/$PROJECT_PATH ]; then
echo "-----> Subdir buildpack in $PROJECT_PATH"
echo " creating cache: $CACHE_DIR"
mkdir -p $CACHE_DIR
TMP_DIR=`mktemp -d $CACHE_DIR/subdirXXXXX`
echo " created tmp dir: $TMP_DIR"
echo " moving working dir: $BUILDPACK_PATH to $TMP_DIR"
cp -R $BUILD_DIR/$BUILDPACK_PATH/. $TMP_DIR/
echo " moving working dir: $PROJECT_PATH to $TMP_DIR"
cp -R $BUILD_DIR/$PROJECT_PATH/. $TMP_DIR/
echo " cleaning build dir $BUILD_DIR"
rm -rf $BUILD_DIR
echo " recreating $BUILD_DIR"
mkdir -p $BUILD_DIR
echo " copying preserved work dir from cache $TMP_DIR to build dir $BUILD_DIR"
cp -Rv $TMP_DIR/. $BUILD_DIR/
cp -R $TMP_DIR/. $BUILD_DIR/
echo " cleaning tmp dir $TMP_DIR"
rm -rf $TMP_DIR
exit 0
fi
fi

echo "BUILDPACK_PATH is undefined"
echo "PROJECT_PATH is undefined"
exit 1


0 comments on commit ac9b773

Please sign in to comment.