#!/bin/bash # Fix ArrayList Zig 0.15 syntax cd /Users/jfraeys/Documents/dev/fetch_ml/cli/src for f in $(find . -name "*.zig" -exec grep -l "ArrayList" {} \;); do # Fix .deinit() -> .deinit(allocator) sed -i '' 's/\.deinit();/.deinit(allocator);/g' "$f" # Fix .toOwnedSlice() -> .toOwnedSlice(allocator) sed -i '' 's/\.toOwnedSlice();/.toOwnedSlice(allocator);/g' "$f" done echo "Fixed deinit and toOwnedSlice patterns"