diff --git a/.gitignore b/.gitignore index caa4595..32c54ce 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,6 @@ app/static/custom_config app/static/bangs # pip stuff -build/ +/build/ dist/ *.egg-info/ diff --git a/app/__init__.py b/app/__init__.py index f77b281..294053c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -101,7 +101,12 @@ for cb_dir in cache_busting_dirs: full_cb_path = os.path.join(full_cb_dir, cb_file) cb_file_link = gen_file_hash(full_cb_dir, cb_file) build_path = os.path.join(app.config['BUILD_FOLDER'], cb_file_link) - os.symlink(full_cb_path, build_path) + + try: + os.symlink(full_cb_path, build_path) + except FileExistsError: + # Symlink hasn't changed, ignore + pass # Create mapping for relative path urls map_path = build_path.replace(app.config['APP_ROOT'], '') diff --git a/app/static/build/.gitignore b/app/static/build/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/app/static/build/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/run b/run index 25fdf15..4ace594 100755 --- a/run +++ b/run @@ -12,8 +12,6 @@ SUBDIR="${1:-app}" export APP_ROOT="$SCRIPT_DIR/$SUBDIR" export STATIC_FOLDER="$APP_ROOT/static" -rm -rf $STATIC_FOLDER/build - # Check for regular vs test run if [[ "$SUBDIR" == "test" ]]; then # Set up static files for testing