mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-04 11:48:22 +02:00
15 lines
No EOL
534 B
Python
15 lines
No EOL
534 B
Python
from . import *
|
|
|
|
|
|
def ctc_patch_bmg(bmgs: list, ctfile: str = "./file/CTFILE.txt"):
|
|
"""
|
|
Patch a bmg file with a ctfile with OVERWRITE option
|
|
:param bmgs: all bmg files
|
|
:param ctfile: the ctfile path
|
|
:return: combined bmg
|
|
"""
|
|
bmg_cmd = []
|
|
for bmg in bmgs: bmg_cmd.extend(["--patch-bmg", f"OVERWRITE={bmg}"])
|
|
return subprocess.run(
|
|
["tools/szs/wctct", "bmg", "--le-code", "--long", ctfile, *bmg_cmd],
|
|
creationflags=CREATE_NO_WINDOW, check=True, stdout=subprocess.PIPE).stdout.decode() |