Upgrader: Allow tar.gz and zip archives

This commit is contained in:
deajan 2024-11-26 14:53:48 +01:00
parent 68f67ec83c
commit 89cda1e7a3

View file

@ -89,7 +89,11 @@ def get_current_version() -> Optional[CurrentVersion]:
def get_file(
file: FileGet, content: bool = False
) -> Optional[Union[FileSend, bytes, dict]]:
possible_filename = f"npbackup-{file.build_type.value}.zip"
if file.platform.value == "windows":
extension = "zip"
else:
extension = "tar.gz"
possible_filename = f"npbackup-{file.build_type.value}.{extension}"
path = os.path.join(
config_dict["upgrades"]["data_root"],
file.platform.value,