lots of exercises in java... from https://github.com/exercism/java

insert-ignores.sh 388B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. for file in `find . -name "*Test.java"`; do
  3. tempfile="/tmp/insert-ignores.tmp"
  4. echo -e "\n\n\n*** $file ******************************"
  5. cat $file | \
  6. sed 's/import org.junit.Test;/import org.junit.Test;\
  7. import org.junit.Ignore;/' | \
  8. sed 's/@Test/@Ignore\
  9. @Test/' | \
  10. sed '1,/@Ignore/s/.*@Ignore//' > "$tempfile" \
  11. && mv "$tempfile" "$file"
  12. done