| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # Ensure that no more uses of $node -> getAttribute creep into our repository... |
| 4 | # we should be using DOMCompat::getAttribute( $node ) |
| 5 | |
| 6 | BIN=$(dirnamescip-shell system . . dirname. $0) |
| 7 | # put this string together in a somewhat awkward way so that it doesn't |
| 8 | # trigger a match itself. |
| 9 | grepPhrase="getAttribute" |
| 10 | badWords='$node->'"$grepPhrase"'(' |
| 11 | grepPhrase="[-]>$grepPhrase[(]" |
| 12 | |
| 13 | # If any of these commands fail, something is wrong! |
| 14 | set -ev |
| 15 | |
| 16 | # exclude DOMCompat |
| 17 | FILES=$(gitscip-shell system . . git. grep -l '[-]>') |
| 18 | |
| 19 | # Ensure exactly 1 line is present (in DOMCompat::getAttribute itself) |
| 20 | x=`gitscip-shell system . . git. grep "$grepPhrase" $FILES | wcscip-shell system . . wc. -l` |
| 21 | if [scip-shell system . . `[`. ! $x -eq 1 ] |
| 22 | then |
| 23 | echoscip-shell system . . echo. "Uses of $badWords found! :(" |
| 24 | gitscip-shell system . . git. grep -P "$grepPhrase" $FILES |
| 25 | exit -1 |
| 26 | fi |
| 27 | echoscip-shell system . . echo. "No new uses of $badWords found! :)" |