Skip to content

Commit

Permalink
Use new .arc adding behavior only when add_files is used
Browse files Browse the repository at this point in the history
  • Loading branch information
RenolY2 committed Sep 16, 2024
1 parent 6766865 commit ac842f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def patch(
# patch files
#log.info(trackzip.namelist())

arcs, files = patcher.get_file_changes("files/")
arcs, files = patcher.get_file_changes("files/", add_files=add_files)
for filepath in files:
if add_files:
patcher.copy_or_add_file("files/" + filepath, "files/" + filepath)
Expand Down
4 changes: 2 additions & 2 deletions src/zip_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def zip_open(self, filepath):
fp = self.zip.open(self.root+filepath)
return fp

def get_file_changes(self, startpath):
def get_file_changes(self, startpath, add_files=False):
if self._is_folder:
startpath = Path(os.path.basename(self.zip.filepath) + os.path.sep + startpath)
else:
Expand All @@ -143,7 +143,7 @@ def get_file_changes(self, startpath):
if len(path.parts) == 0:
continue

if filepath.endswith(".arc"):
if add_files and filepath.endswith(".arc"):
arc = -1
else:
arc = find_arc(path)
Expand Down

0 comments on commit ac842f5

Please sign in to comment.