⚡ Bolt: Optimize file filtering and fix content extraction#14
Conversation
Refactored `codepack.sh` to use `find` predicates for file filtering instead of a Bash loop, significantly improving performance for large directories. Replaced Bash 4+ `mapfile` with a `while` loop for Bash 3.2 compatibility (macOS). Fixed a critical bug where `sed 's// /g'` caused all file content to be lost; replaced with `tr -cd` for binary stripping.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
It is ok |
Acknowledged. |
💡 What:
list_files_to_processto usefindnative filtering (names, paths, extensions) instead of piping to a Bash loop.mapfile(Bash 4+) withwhile readloop for Bash 3.2 compatibility.sed 's// /g'command inextract_files_contentthat caused empty output.should_process_fileto correctly handleinclude_mode(although now primary filtering is done byfind, this remains forgenerate_tree).🎯 Why:
findis much faster at filtering files than a Bash loop. This reduces the number of subshells and iterations.sedcommand was incorrectly formed and resulted in data loss (empty files).mapfile.📊 Impact:
🔬 Measurement:
perf_testbenchmark (250 files).test_basic.sh.PR created automatically by Jules for task 9608917815950385740 started by @w3spi5