| 1 | #!/bin/sh |
| 2 | |
| 3 | rebase_onto="$1" |
| 4 | |
| 5 | for dir in node_modules test/reference; do |
| 6 | # If a particular submodule is... |
| 7 | if test -e "${dir}/.git" && # ...checked out... |
| 8 | test -z "$(git status --porcelain "${dir}")" && # ...clean... |
| 9 | ! git diff --quiet "${rebase_onto}" -- "${dir}" # ...and changed on origin... |
| 10 | then |
| 11 | # then save ourselves the trouble of it being wrong post-rebase. |
| 12 | echo "Removing soon-to-be out-of-date ${dir}..." |
| 13 | rm -rf "${dir}" |
| 14 | mkdir "${dir}" |
| 15 | fi |
| 16 | done |