lang-clean.sh 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_$1.tmp
  25. rm_if_exists lang_en_$1.tmp
  26. rm_if_exists lang_en_$1.dif
  27. rm_if_exists lang_$1.ofs
  28. rm_if_exists lang_$1.txt
  29. fi
  30. rm_if_exists lang_$1_check.dif
  31. rm_if_exists lang_$1.bin
  32. rm_if_exists lang_$1.dat
  33. rm_if_exists lang_$1_1.tmp
  34. rm_if_exists lang_$1_2.tmp
  35. }
  36. echo "lang-clean.sh started" >&2
  37. clean_lang en
  38. clean_lang cz
  39. clean_lang de
  40. clean_lang es
  41. clean_lang fr
  42. clean_lang it
  43. clean_lang pl
  44. echo -n "lang-clean.sh finished" >&2
  45. if [ $result -eq 0 ]; then
  46. echo " with success" >&2
  47. else
  48. echo " with errors!" >&2
  49. fi
  50. case "$-" in
  51. *i*) echo "press enter key" >&2; read ;;
  52. esac
  53. exit $result