Игра Маджонг | Mahjong game
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
526B

  1. #!/bin/bash
  2. # Создать файл JavaScript с набором раскладок в формате Base64.
  3. function gen
  4. {
  5. fileName=$1
  6. target=$2
  7. echo -n "'$fileName' : '" >> $target
  8. base64 $fileName | tr -d \\n >> $target
  9. echo -e "',\n" >> $target
  10. }
  11. function genLayouts
  12. {
  13. target=$1
  14. echo -e "function RR() { return {\n" > $target
  15. layouts=$(ls *.layout)
  16. for layout in $layouts;
  17. do
  18. gen $layout $target
  19. done
  20. echo "}; }" >> $target
  21. }
  22. genLayouts "../2019-09-19.js"