mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Tools - Update setup.py for hemmt dev
filepatching (#9231)
* Update setup.py * Update setup.py
This commit is contained in:
parent
7cbdb7f410
commit
a34d9455d2
@ -17,6 +17,7 @@ PROJECTDIR = "ace"
|
|||||||
CBA = "P:\\x\\cba"
|
CBA = "P:\\x\\cba"
|
||||||
##########################
|
##########################
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
FULLDIR = "{}\\{}".format(MAINDIR, PROJECTDIR)
|
FULLDIR = "{}\\{}".format(MAINDIR, PROJECTDIR)
|
||||||
print("""
|
print("""
|
||||||
@ -63,7 +64,17 @@ def main():
|
|||||||
if repl.lower() != "y":
|
if repl.lower() != "y":
|
||||||
return 3
|
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)):
|
if os.path.exists("P:\\{}\\{}".format(MAINDIR, PROJECTDIR)):
|
||||||
print("Link on P: already exists. Please finish the setup manually.")
|
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)):
|
if os.path.exists(os.path.join(armapath, MAINDIR, PROJECTDIR)):
|
||||||
print("Link in Arma directory already exists. Please finish the setup manually.")
|
print("Link in Arma directory already exists. Please finish the setup manually.")
|
||||||
return 5
|
return 5
|
||||||
|
print("\n# Creating links ...")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists("P:\\{}".format(MAINDIR)):
|
if not os.path.exists("P:\\{}".format(MAINDIR)):
|
||||||
@ -80,7 +92,7 @@ def main():
|
|||||||
os.mkdir(os.path.join(armapath, MAINDIR))
|
os.mkdir(os.path.join(armapath, MAINDIR))
|
||||||
|
|
||||||
subprocess.call(["cmd", "/c", "mklink", "/J", "P:\\{}\\{}".format(MAINDIR, PROJECTDIR), projectpath])
|
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:
|
except:
|
||||||
raise
|
raise
|
||||||
print("Something went wrong during the link creation. Please finish the setup manually.")
|
print("Something went wrong during the link creation. Please finish the setup manually.")
|
||||||
@ -88,7 +100,6 @@ def main():
|
|||||||
|
|
||||||
print("# Links created successfully.")
|
print("# Links created successfully.")
|
||||||
|
|
||||||
|
|
||||||
print("\n# Copying required CBA includes ...")
|
print("\n# Copying required CBA includes ...")
|
||||||
|
|
||||||
if os.path.exists(CBA):
|
if os.path.exists(CBA):
|
||||||
|
Loading…
Reference in New Issue
Block a user