build_images.sh 485 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. BASE=.$$images.h
  3. FINAL=images.h
  4. export PATH=$PATH:$1:.
  5. # export PATH=$PATH:build:.
  6. echo "Adding $1 to path"
  7. # echo $PATH
  8. ansi-to-src ansi/*.ans > $BASE
  9. # workaround
  10. if [ -f "$FINAL" ]; then
  11. # file exists
  12. diff -q $BASE $FINAL
  13. status=$?
  14. if [ $status -eq 0 ]; then
  15. echo "no change..."
  16. # Clean up temp file
  17. rm -f $BASE
  18. else
  19. mv -f $BASE $FINAL
  20. fi
  21. else
  22. # file doesn't exist, so no choice by to copy it over.
  23. mv -f $BASE $FINAL
  24. fi