copy_res_android.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # shell脚本文件路径
  3. shellFilePath=$(cd "$(dirname "$0")"; pwd)
  4. # echo "shell脚本文件路径:" $shellFilePath
  5. appResFolderPath=$1
  6. #参数$1:app资源文件夹
  7. #参数$2:需要拷贝的文件夹
  8. #参数$3:是否递归拷贝
  9. #参数$4:拷贝是否保留相对文件夹
  10. function copyFiles() {
  11. if [ ! -d $1 ]; then
  12. echo "创建文件夹:" $1
  13. mkdir $1
  14. fi
  15. if [ -f $2 ]; then
  16. echo "拷贝文件:" $2
  17. cp $2 $1
  18. else
  19. if [ -s $2 ]; then
  20. for file in $2/*; do
  21. if [ -d $file ]; then
  22. if [ $3 == "true" ]; then
  23. if [ $4 == "true" ]; then
  24. copyFiles $1'/'$(basename $file) $file $3 $4
  25. else
  26. copyFiles $1 $file $3 $4
  27. fi
  28. fi
  29. else
  30. copyFiles $1 $file $3 $4
  31. fi
  32. done
  33. fi
  34. fi
  35. }
  36. copyFiles $appResFolderPath $shellFilePath'/../ccbi' "true" "false"
  37. copyFiles $appResFolderPath $shellFilePath'/../conf' "true" "false"
  38. copyFiles $appResFolderPath $shellFilePath'/../font' "true" "false"
  39. copyFiles $appResFolderPath $shellFilePath'/../plist' "true" "false"
  40. copyFiles $appResFolderPath $shellFilePath'/../png_noplist' "true" "false"
  41. copyFiles $appResFolderPath $shellFilePath'/../level' "true" "false"
  42. copyFiles $appResFolderPath $shellFilePath'/../spine_export' "true" "false"
  43. copyFiles $appResFolderPath'/Res_Sound' $shellFilePath'/../sound' "true" "false"