Skip to content

Commit

Permalink
提供更多选择,同时提供剔除冗余版本资源包、非剔除冗余版本资源包
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Feb 11, 2018
1 parent ee86d56 commit a75eb44
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ deploy:
provider: releases
api_key:
secure: KmeoGPGKBYjliQomtTeynl6Q42m/3k9jf/2FY6qu8fX8uqA4RhgZsdphP9PZ1WkKNds80H9p7zSAc57l8qrPkLoyYOfJGRiZZB68G6/AKKV0xTm4SV/6ItoTa7sSQkFNr1U1UBdvDiC7RRpPWMyVwxFefT5GWxg15/+O5DNkAgMwn4/Ea0l5q358Rgod3WkdKeLT3QPrEjY+8lUUlC4edYwVJhe2U/pAHcDkOGQJQX+JAVd+ss6QHK4FAk0vFm0demIT2/ByPkqmajo5M1vSLFnhoOMJdyIeNKeZGslydAgUGf3AQCn7VoPV4zBa3+q2sEEVDVMZkp2HjxgYBfzk9M00EJ78ETryIetpa6r7rVPz+rxAVyzJqdhCH4/TqCA+a6j0j/axqqyVNfPqqU2wPEgCindvU9hMjJ3y1be6gmElGdDP0uDab3/lGUWiZdwFr32G732QA7LV+ZeTABAuhCoOz9WAFMN4mDI7dwPn67D2FEfa/Q6e7aiaEG0A/M90bqlKs0bkhubNczJJgl2s2FXKsHzPLU7GXRlT6kgt1I7WzTBMuGvHrqJ5mBGNCQMsELjAoZuzskqbvsdqzgDF8VUj+n2VSMYQzksBK0+g8lJ9eH2KWr1MRPekENaQf47Xh9T1BPTsf3Hcu9xwcNhneUYyTgBol3Pg3PjqRFdrO2Y=
file: Minecraft-Mod-Language-Modpack.zip
file:
- "Minecraft-Mod-Language-Modpack.zip"
- "Minecraft-Mod-Language-Modpack-Lite.zip"
skip_cleanup: true
on:
repo: CFPAOrg/Minecraft-Mod-Language-Package
Expand Down
24 changes: 20 additions & 4 deletions zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@
import os
import src.redundancy.redundancy

# 这里打包的是剔除冗余的版本
os.system('mv ./project-tmp/assets ./')
os.system('mv ./project-tmp/pack.mcmeta ./')
os.system('mv ./project-tmp/pack.png ./')
os.system('zip -r -9 "Minecraft-Mod-Language-Modpack.zip" "assets" "pack.mcmeta" "pack.png" "README.md" "LICENSE"')
os.system('zip -r -9 "Minecraft-Mod-Language-Modpack-Lite.zip" "assets" "pack.mcmeta" "pack.png" "README.md" "LICENSE"')
# 只需要剔除 assets 文件夹即可
os.system('rm -rf ./assets')
os.system('rm -rf ./pack.mcmeta')
os.system('rm -rf ./pack.png')

os.system('rm -rf ./project-tmp')
# 接下来是不剔除冗余保留版本的打包
# 处理主程序
for modid in os.listdir('project/assets'):
# 先判断 zh_cn 存在不存在
if not os.path.exists('project/assets/{}/lang/zh_cn.lang'.format(modid)):
continue
# 剔除 en_us
os.system('rm -f project/assets/{}/lang/en_us.lang'.format(modid))
# 再剔除 zh_cn_old
os.system('rm -f project/assets/{}/lang/zh_cn_old.lang'.format(modid))
# 最后判断文件是否为空
if os.path.getsize('project/assets/{}/lang/zh_cn.lang'.format(modid)) == 0:
os.system('rm -rf project/assets/{}'.format(modid))

# 最后打包
os.system('mv ./project/assets ./')
os.system('zip -r -9 "Minecraft-Mod-Language-Modpack.zip" "assets" "pack.mcmeta" "pack.png" "README.md" "LICENSE"')

0 comments on commit a75eb44

Please sign in to comment.