@@ -292,33 +292,27 @@ function copy_files() {
292292 # Copy selected tool scripts instead of entire tools directory
293293 local tools_src=" ${BOOSTER_INTERNAL_PATH} /tools"
294294 if [ -d " $tools_src " ]; then
295- mkdir -p tools/git-hooks/hooks
296- # List of tool files to copy (public runtime helpers only)
297- local tool_files=(
298- " runner.sh"
299- " commit-utils.py"
300- " git-hooks"
301- )
302- for f in " ${tool_files[@]} " ; do
303- if [ -f " $tools_src /$f " ]; then
304- log " Copying tool '$f '"
305- cp " $tools_src /$f " tools/
306- # Set execute permissions for shell scripts and Python files
307- if [[ " $f " == * .sh ]] || [[ " $f " == * .py ]]; then
308- chmod +x " tools/$f "
309- fi
310- elif [ -d " $tools_src /$f " ]; then
311- log " Copying tool directory '$f '"
312- cp -R " $tools_src /$f " tools/
313- # Set execute permissions for shell scripts in the directory
314- find " tools/$f " -name " *.sh" -exec chmod +x {} \;
315- find " tools/$f " -name " *.bash" -exec chmod +x {} \;
316- else
317- warn " Expected tool file missing: $f "
318- fi
319- done
320-
295+ mkdir -p tools/git-hooks
296+
297+ # Copy git-hooks/hooks directory
298+ if [ -d " $tools_src /git-hooks/hooks" ]; then
299+ log " Copying git-hooks/hooks directory"
300+ cp -R " $tools_src /git-hooks/hooks" tools/git-hooks/
301+ # Set execute permissions for all scripts in hooks directory
302+ find " tools/git-hooks/hooks" -type f \( -name " *.sh" -o -name " *.bash" -o -name " *.mjs" \) -exec chmod +x {} \;
303+ else
304+ warn " Expected tool directory missing: git-hooks/hooks"
305+ fi
321306
307+ # Copy git-hooks/shared directory
308+ if [ -d " $tools_src /git-hooks/shared" ]; then
309+ log " Copying git-hooks/shared directory"
310+ cp -R " $tools_src /git-hooks/shared" tools/git-hooks/
311+ # Set execute permissions for scripts in shared directory
312+ find " tools/git-hooks/shared" -type f \( -name " *.sh" -o -name " *.bash" -o -name " *.mjs" \) -exec chmod +x {} \;
313+ else
314+ warn " Expected tool directory missing: git-hooks/shared"
315+ fi
322316 else
323317 warn " Booster tools directory not found; skipping tools copy."
324318 fi
@@ -358,7 +352,8 @@ function update_package_json() {
358352 .[0] as $proj | .[1] as $booster |
359353 $proj * {
360354 scripts: (($proj.scripts // {}) + ($booster.scripts // {})),
361- devDependencies: (($proj.devDependencies // {}) + ($booster.devDependencies // {}))
355+ devDependencies: (($proj.devDependencies // {}) + ($booster.devDependencies // {})),
356+ husky: (($proj.husky // {}) + ($booster.husky // {}))
362357 }
363358 ' " $project_pkg " " $booster_pkg " > " $tmp_pkg " || error " Failed to merge package.json using jq."
364359
0 commit comments