#!/bin/bash
echo "Replacing die with _die in all template scripts..."
find templates -type f -name "*.sh" | grep -v "_common.sh\|test_template.sh" | while read -r file; do
  if grep -q "\bdie\b" "$file"; then
    sed -i "s/\\bdie\\b/_die/g" "$file"
    echo "Updated: $file"
  fi
done
echo "Replacement complete!"
