Chetan Gaonker | cfcce78 | 2016-05-10 10:10:42 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | for f in `find . -name "*.py"`; do |
| 3 | if ! grep -q Copyright $f; then |
| 4 | cat COPYRIGHT.txt $f > $f.license.py |
| 5 | mv $f.license.py $f |
Chetan Gaonker | 89a2e32 | 2016-05-10 13:21:56 -0700 | [diff] [blame] | 6 | if grep -q "^\#\!/usr/bin" $f; then |
| 7 | #prepend shebang for python |
| 8 | sed -i -e '/^\#\!\/usr\/bin/d' -e '1i\#\!/usr/bin/env python' $f |
| 9 | chmod +x $f |
| 10 | fi |
Chetan Gaonker | cfcce78 | 2016-05-10 10:10:42 -0700 | [diff] [blame] | 11 | fi |
Chetan Gaonker | cb122cc | 2016-05-10 10:58:34 -0700 | [diff] [blame] | 12 | done |