lang-clean.sh 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. #
  3. # clean.sh - multi-language support script
  4. # Remove all language output files from lang folder.
  5. #
  6. result=0
  7. rm_if_exists()
  8. {
  9. if [ -e $1 ]; then
  10. echo -n " removing '$1'..." >&2
  11. if rm $1; then
  12. echo "OK" >&2
  13. else
  14. echo "NG!" >&2
  15. result=1
  16. fi
  17. fi
  18. }
  19. clean_lang()
  20. {
  21. if [ "$1" = "en" ]; then
  22. rm_if_exists lang_$1.tmp
  23. else
  24. rm_if_exists lang_en_$1.tmp
  25. rm_if_exists lang_en_$1.dif
  26. rm_if_exists lang_$1.ofs
  27. rm_if_exists lang_$1.txt
  28. fi
  29. rm_if_exists lang_$1.bin
  30. rm_if_exists lang_$1.dat
  31. }
  32. echo "lang-clean.sh started" >&2
  33. clean_lang en
  34. clean_lang cz
  35. clean_lang de
  36. clean_lang es
  37. clean_lang fr
  38. clean_lang it
  39. clean_lang pl
  40. echo -n "lang-clean.sh finished" >&2
  41. if [ $result -eq 0 ]; then
  42. echo " with success" >&2
  43. else
  44. echo " with errors!" >&2
  45. fi
  46. case "$-" in
  47. *i*) echo "press enter key" >&2; read ;;
  48. esac
  49. exit $result