mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
build archieve tool
This commit is contained in:
38
resources/tools/mkrelease.py
Normal file
38
resources/tools/mkrelease.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
|
||||
from zipfile import *
|
||||
|
||||
|
||||
IGNORED_PATHS = [
|
||||
"__pycache__",
|
||||
".gitignore",
|
||||
".gitmodules",
|
||||
".git",
|
||||
".idea",
|
||||
".DS_Store",
|
||||
|
||||
"build",
|
||||
]
|
||||
|
||||
VERSION = "1.3.2"
|
||||
|
||||
|
||||
def _mk_archieve():
|
||||
archieve = ZipFile("build/dcs_liberation_{}.zip".format(VERSION), "w")
|
||||
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
||||
|
||||
for path, directories, files in os.walk("."):
|
||||
is_ignored = False
|
||||
for ignored_path in IGNORED_PATHS:
|
||||
if ignored_path in path:
|
||||
is_ignored = True
|
||||
break
|
||||
|
||||
if is_ignored:
|
||||
continue
|
||||
|
||||
for file in files:
|
||||
archieve.write(os.path.join(path, file))
|
||||
|
||||
|
||||
_mk_archieve()
|
||||
Reference in New Issue
Block a user