mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Stop requiring user input for mkrelease.py.
This commit is contained in:
parent
92c404fbb6
commit
4415429661
@ -1,7 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from zipfile import *
|
THIS_DIR = Path(__file__).resolve()
|
||||||
|
SRC_DIR = THIS_DIR.parents[1]
|
||||||
|
|
||||||
|
|
||||||
IGNORED_PATHS = [
|
IGNORED_PATHS = [
|
||||||
@ -15,10 +17,8 @@ IGNORED_PATHS = [
|
|||||||
"venv",
|
"venv",
|
||||||
]
|
]
|
||||||
|
|
||||||
VERSION = input("version str:")
|
|
||||||
|
|
||||||
|
def _zip_dir(archive, path):
|
||||||
def _zip_dir(archieve, path):
|
|
||||||
for path, directories, files in os.walk(path):
|
for path, directories, files in os.walk(path):
|
||||||
is_ignored = False
|
is_ignored = False
|
||||||
for ignored_path in IGNORED_PATHS:
|
for ignored_path in IGNORED_PATHS:
|
||||||
@ -32,29 +32,16 @@ def _zip_dir(archieve, path):
|
|||||||
for file in files:
|
for file in files:
|
||||||
if file in IGNORED_PATHS:
|
if file in IGNORED_PATHS:
|
||||||
continue
|
continue
|
||||||
archieve.write(os.path.join(path, file))
|
archive.write(os.path.join(path, file))
|
||||||
|
|
||||||
|
|
||||||
def _mk_archieve():
|
def main():
|
||||||
path = os.path.join(
|
|
||||||
os.path.dirname(__file__),
|
|
||||||
os.pardir,
|
|
||||||
os.pardir,
|
|
||||||
"build",
|
|
||||||
"dcs_liberation_{}.zip".format(VERSION),
|
|
||||||
)
|
|
||||||
if os.path.exists(path):
|
|
||||||
print("version already exists")
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree("./dist")
|
shutil.rmtree("./dist")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
os.system("pyinstaller.exe --clean pyinstaller.spec")
|
os.system("pyinstaller.exe --clean pyinstaller.spec")
|
||||||
# archieve = ZipFile(path, "w")
|
|
||||||
# archieve.writestr("dcs_liberation.bat", "cd dist\\dcs_liberation\r\nliberation_main \"%UserProfile%\\Saved Games\" \"{}\"".format(VERSION))
|
|
||||||
# _zip_dir(archieve, "./dist/dcs_liberation")
|
|
||||||
|
|
||||||
|
|
||||||
_mk_archieve()
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user