fix: resolve mapfile compatibility issue in build architecture guard

- Replace mapfile command with portable alternative for cross-shell compatibility
- Add troubleshooting documentation for common shell compatibility issues
- Update BUILDING.md with Build Architecture Guard documentation
- Ensure script works across different shell environments

Fixes pre-commit hook failures on macOS and other systems where mapfile is not available.
This commit is contained in:
Matthew Raymer
2025-08-22 08:16:04 +00:00
parent cd327b0b91
commit a6a71628ec
3 changed files with 98 additions and 1 deletions

View File

@@ -111,7 +111,10 @@ main() {
log_info "Running Build Architecture Guard..."
# Collect changed files
mapfile -t changed_files < <(collect_files "$mode" "$arg")
changed_files=()
while IFS= read -r line; do
[[ -n "$line" ]] && changed_files+=("$line")
done < <(collect_files "$mode" "$arg")
if [[ ${#changed_files[@]} -eq 0 ]]; then
log_info "No files changed, guard check passed"