mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
allow roms with spaces to be extracted (#868)
using subprocess instead of os.system() is a little safer, and allows for roms with spaces to be extraced. i've noticed this is somewhat common in people reporting issues on discord.
This commit is contained in:
parent
87ed5fedfd
commit
b6af684583
@ -5,6 +5,7 @@ import shutil
|
||||
from rom_info import Z64Rom
|
||||
import rom_chooser
|
||||
import struct
|
||||
import subprocess
|
||||
|
||||
def BuildOTR(xmlPath, rom):
|
||||
shutil.copytree("assets", "Extract/assets")
|
||||
@ -13,11 +14,13 @@ def BuildOTR(xmlPath, rom):
|
||||
with open("Extract/version", "wb") as f:
|
||||
f.write(struct.pack('<L', checksum))
|
||||
|
||||
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)
|
||||
zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
||||
exec_cmd = [zapd_exe, "ed", "-i", xmlPath, "-b", rom, "-fl", "CFG/filelists",
|
||||
"-o", "placeholder", "-osf", "placeholder", "-gsf", "1",
|
||||
"-rconf", "CFG/Config.xml", "-se", "OTR"]
|
||||
|
||||
print(execStr)
|
||||
exitValue = os.system(execStr)
|
||||
print(exec_cmd)
|
||||
exitValue = subprocess.call(exec_cmd)
|
||||
if exitValue != 0:
|
||||
print("\n")
|
||||
print("Error when building the OTR file...", file=os.sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user