Create basepatch in proper directory if required.

This commit is contained in:
caitsith2
2020-06-20 19:14:09 -07:00
parent 95742ddb98
commit e1bfa8780c
2 changed files with 3 additions and 4 deletions

View File

@@ -49,11 +49,11 @@ def generate_patch(rom: bytes, metadata: Optional[dict] = None) -> bytes:
return generate_yaml(patch, metadata)
def create_patch_file(rom_file_to_patch: str, server: str = "") -> str:
def create_patch_file(rom_file_to_patch: str, server: str = "", destination: str = None) -> str:
bytes = generate_patch(load_bytes(rom_file_to_patch),
{
"server": server}) # allow immediate connection to server in multiworld. Empty string otherwise
target = os.path.splitext(rom_file_to_patch)[0] + ".bmbp"
target = destination if destination else os.path.splitext(rom_file_to_patch)[0] + ".bmbp"
write_lzma(bytes, target)
return target