Update caching logic so new apps don't get logs

actually add changes

Missing fi
This commit is contained in:
Casey Faist
2020-03-19 17:01:39 -04:00
parent b8fd617d9c
commit 6a02499140
2 changed files with 20 additions and 8 deletions
+18 -6
View File
@@ -95,14 +95,26 @@ if [ -f .heroku/python-version ]; then
fi
fi
echo "$(diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt")"
# Remove python dependencies
if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]] || ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt" ; then
# Check if we should reinstall python dependencies
if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]]; then
# IF there's no cached dependencies, update cached version of requirements.txt
# This should only run for new apps and first deploys after this update
cp -R $BUILD_DIR/requirements.txt "$CACHE_DIR/.heroku/requirements.txt"
# If we don't already have a python version, this is a new app
if [ -f .heroku/python-version ]; then
puts-step "Clearing cached dependencies"
# if there are any differences, clear the Python cache
# Installing Python over again does not take noticably more time
rm -rf .heroku/python
fi
else
# IF there IS a cached directory, check for differences with the new one
if ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"; then
puts-step "Clearing cached dependencies"
# if there are any differences, clear the Python cache
# Installing Python over again does not take noticably more time
rm -rf .heroku/python
fi
fi
if [ ! "$SKIP_INSTALL" ]; then