mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-24 06:41:52 -05:00

This reverts commit 55f114e3d499f510eadab5f918b7eb95fd9dd249, reversing changes made to 2809cd01dffb7f1a1df1068adaae8f2b1b44ae85.
33 lines
917 B
Python
Executable File
33 lines
917 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os, sys, shutil
|
|
import shutil
|
|
from rom_info import Z64Rom
|
|
import rom_chooser
|
|
|
|
def BuildOTR(xmlPath, rom):
|
|
shutil.copytree("assets", "Extract/assets")
|
|
|
|
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
|
execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom)
|
|
|
|
print(execStr)
|
|
exitValue = os.system(execStr)
|
|
if exitValue != 0:
|
|
print("\n")
|
|
print("Error when building the OTR file...", file=os.sys.stderr)
|
|
print("Aborting...", file=os.sys.stderr)
|
|
print("\n")
|
|
|
|
def main():
|
|
rom_path = rom_chooser.chooseROM()
|
|
rom = Z64Rom(rom_path)
|
|
|
|
if (os.path.exists("Extract")):
|
|
shutil.rmtree("Extract")
|
|
|
|
BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|