build_images.sh 475 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. BASE=.$$images.h
  3. FINAL=images.h
  4. ansi-to-src ansi/*.ans > $BASE
  5. if [ $? -eq 127 ]; then
  6. echo "using default, missing ansi-to-src"
  7. exit 0
  8. fi
  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