Skip to content

Commit

Permalink
fix capsule nonexistent error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Oct 29, 2023
1 parent 11d7208 commit 1fcea6f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pykotor/tslpatcher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,20 @@ def should_patch(
action = patch.action if hasattr(patch, "action") else "Patch "

if replace_file and exists:
if capsule:
if capsule is not None:
self.log.add_note(f"{action[:-1]}ing '{patch.filename}' and replacing existing resource in the '{local_folder}' archive")
else:
self.log.add_note(f"{action[:-1]}ing '{patch.filename}' and replacing existing file in the '{local_folder}' folder")
elif no_replacefile_check and exists:
if capsule:
if capsule is not None:
self.log.add_note(f"{action[:-1]}ing existing resource '{patch.filename}' in the '{local_folder}' archive")
else:
self.log.add_note(f"{action[:-1]}ing existing file '{patch.filename}' in the '{local_folder}' folder")
elif is_replaceable and exists:
if capsule and not capsule._path.exists():
self.log.add_error(f"The capsule '{patch.destination}' did not exist when attempting to {action.lower()} '{patch.filename}'. Skipping file...")
else:
self.log.add_warning(f"'{patch.filename}' already exists in the '{local_folder}' {container_type}. Skipping file...")
self.log.add_warning(f"'{patch.filename}' already exists in the '{local_folder}' {container_type}. Skipping file...")
return False
elif capsule is not None and not capsule._path.exists():
self.log.add_error(f"The capsule '{patch.destination}' did not exist when attempting to {action.lower().rstrip()} '{patch.filename}'. Skipping file...")
else:
self.log.add_note(f"{action[:-1]}ing '{patch.filename}' and {'adding' if capsule else 'saving'} to the '{local_folder}' {container_type}")
return True
Expand Down

0 comments on commit 1fcea6f

Please sign in to comment.