Tools - Update setup.py for hemmt dev filepatching (#9231)

* Update setup.py

* Update setup.py
This commit is contained in:
PabstMirror 2023-09-12 13:47:21 -05:00 committed by GitHub
parent 7cbdb7f410
commit a34d9455d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ PROJECTDIR = "ace"
CBA = "P:\\x\\cba"
##########################
def main():
FULLDIR = "{}\\{}".format(MAINDIR, PROJECTDIR)
print("""
@ -63,7 +64,17 @@ def main():
if repl.lower() != "y":
return 3
print("\n# Creating links ...")
hemmt_path = os.path.join(projectpath, ".hemttout", "dev")
print("\n# Use Hemmt Dev Path for arma filepatching:")
print(f" y: {hemmt_path}")
print(f" n: {projectpath}")
repl = input("(y/n): ")
filepatching_path = projectpath
if repl.lower() == "y":
if not os.path.exists(hemmt_path):
print(f"creating {hemmt_path}")
os.makedirs(hemmt_path)
filepatching_path = hemmt_path
if os.path.exists("P:\\{}\\{}".format(MAINDIR, PROJECTDIR)):
print("Link on P: already exists. Please finish the setup manually.")
@ -72,6 +83,7 @@ def main():
if os.path.exists(os.path.join(armapath, MAINDIR, PROJECTDIR)):
print("Link in Arma directory already exists. Please finish the setup manually.")
return 5
print("\n# Creating links ...")
try:
if not os.path.exists("P:\\{}".format(MAINDIR)):
@ -80,7 +92,7 @@ def main():
os.mkdir(os.path.join(armapath, MAINDIR))
subprocess.call(["cmd", "/c", "mklink", "/J", "P:\\{}\\{}".format(MAINDIR, PROJECTDIR), projectpath])
subprocess.call(["cmd", "/c", "mklink", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), projectpath])
subprocess.call(["cmd", "/c", "mklink", "/J", os.path.join(armapath, MAINDIR, PROJECTDIR), filepatching_path])
except:
raise
print("Something went wrong during the link creation. Please finish the setup manually.")
@ -88,7 +100,6 @@ def main():
print("# Links created successfully.")
print("\n# Copying required CBA includes ...")
if os.path.exists(CBA):