mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
48 lines
895 B
Python
48 lines
895 B
Python
import os
|
|
from pathlib import Path
|
|
import shutil
|
|
|
|
THIS_DIR = Path(__file__).resolve()
|
|
SRC_DIR = THIS_DIR.parents[1]
|
|
|
|
|
|
IGNORED_PATHS = [
|
|
"__pycache__",
|
|
".gitignore",
|
|
".git",
|
|
".idea",
|
|
".DS_Store",
|
|
"requirements.txt",
|
|
"build",
|
|
"venv",
|
|
]
|
|
|
|
|
|
def _zip_dir(archive, path):
|
|
for path, directories, files in os.walk(path):
|
|
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:
|
|
if file in IGNORED_PATHS:
|
|
continue
|
|
archive.write(os.path.join(path, file))
|
|
|
|
|
|
def main():
|
|
try:
|
|
shutil.rmtree("./dist")
|
|
except FileNotFoundError:
|
|
pass
|
|
os.system("pyinstaller.exe --clean pyinstaller.spec")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|