build_images.sh 494 B

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