Skip to content

Commit

Permalink
Copy slugignore and .git clearing implementation from slug-compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Dec 11, 2012
1 parent 4c02955 commit c192e5e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,26 @@ EOF

chmod +x boot.sh

# Normally slugignore and pruning .git/DS_Store are done in the slug compiler,
# but since the PHP buildpack moves everything out of $BUILD_DIR into
# www/ we can't rely on that implementation and need to duplicate it here.

if [ -r $BUILD_DIR/www/.slugignore ]; then
unset GIT_DIR
cd www
if [ $(git ls-files -z -o -i --exclude-from=.slugignore) != "" ]; then
git ls-files -z -o -i --exclude-from=.slugignore | xargs -0 rm
fi
cd ..
fi

if [ -d $BUILD_DIR/www/.git ]; then
rm -rf $BUILD_DIR/www/.git
fi

if [ $(find $BUILD_DIR -name .DS_Store -print0) != "" ]; then
find $BUILD_DIR -name .DS_Store -print0 | xargs -0 rm
fi

# clean the cache
rm -rf $CACHE_DIR/*

0 comments on commit c192e5e

Please sign in to comment.