lang-clean.sh 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 nl
  44. clean_lang pl
  45. echo -n "lang-clean.sh finished" >&2
  46. if [ $result -eq 0 ]; then
  47. echo " with success" >&2
  48. else
  49. echo " with errors!" >&2
  50. fi
  51. case "$-" in
  52. *i*) echo "press enter key" >&2; read ;;
  53. esac
  54. exit $result