mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-04 03:38:26 +02:00
the file were not seeked to 0 after writing, causing a file set on match mode to only copy the first matched file, and then write empty file on the others
This commit is contained in:
parent
3eef32e202
commit
cd064556b0
1 changed files with 2 additions and 0 deletions
|
@ -392,6 +392,7 @@ class PatchFile(PatchObject):
|
||||||
|
|
||||||
game_subpath.parent.mkdir(parents=True, exist_ok=True)
|
game_subpath.parent.mkdir(parents=True, exist_ok=True)
|
||||||
with open(game_subpath.parent / patch_name, "wb") as file:
|
with open(game_subpath.parent / patch_name, "wb") as file:
|
||||||
|
patch_content.seek(0)
|
||||||
file.write(patch_content.read())
|
file.write(patch_content.read())
|
||||||
|
|
||||||
# if the mode is match, replace all the subfiles that match match_regex by the PatchFile
|
# if the mode is match, replace all the subfiles that match match_regex by the PatchFile
|
||||||
|
@ -405,6 +406,7 @@ class PatchFile(PatchObject):
|
||||||
|
|
||||||
game_subfile.parent.mkdir(parents=True, exist_ok=True)
|
game_subfile.parent.mkdir(parents=True, exist_ok=True)
|
||||||
with open(game_subfile, "wb") as file:
|
with open(game_subfile, "wb") as file:
|
||||||
|
patch_content.seek(0)
|
||||||
file.write(patch_content.read())
|
file.write(patch_content.read())
|
||||||
|
|
||||||
# else raise an error
|
# else raise an error
|
||||||
|
|
Loading…
Reference in a new issue