3 # I still can't believe I am doing this
6 components="piece.py board.py player.py thread_util.py game.py graphics.py main.py"
7 # The below seems nicer, but doesn't work because things need to be imported in the right order :(
8 #components=$(ls *.py | tr '\t' '\n' | grep -v $target)
10 header="#!/usr/bin/python -u"
11 footer="# EOF - created from update.sh on $(date)"
15 # If the target was modified more recently than any of the components, update the component file
16 target_mod=$(stat -c %Y $target)
20 for f in $components; do
21 if [ $(stat -c %Y $f) -lt $target_mod ]; then
22 nawk "/+++ $f +++/, /--- $f ---/" $target | grep -v "+++ $f +++" | grep -v "\--- $f ---" > $f
27 if $merge_required; then
28 echo $header > $target
29 for f in $components; do
30 cat $components >> $target
33 echo $footer > $target