diff --git a/bin/compile b/bin/compile index 9db7e017f..1deba7415 100755 --- a/bin/compile +++ b/bin/compile @@ -66,10 +66,13 @@ chmod +x boot.sh # 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 [ "$(cd $BUILD_DIR/www && git ls-files -o -i --exclude-from=.slugignore 2> /dev/null)" != "" ]; then - echo "-----> Deleting files matching .slugignore patterns." +if [ -r $BUILD_DIR/www/.slugignore ]; then + unset GIT_DIR cd www - git ls-files -z -o -i --exclude-from=.slugignore | xargs -0 rm + if [ "$(git ls-files -c -o -i --exclude-from=.slugignore)" != "" ]; then + echo "-----> Deleting files matching .slugignore patterns." + git ls-files -z -c -o -i --exclude-from=.slugignore | xargs -0 rm + fi cd .. fi