fix(core): standardize handling of None values for repo and version fields

- Improve local and remote version comparison by replacing default placeholders with None.
- Update repo and branch logic to handle None values consistently.
- Refactor type hints for better readability and accuracy.
This commit is contained in:
dw-0
2026-01-18 15:49:48 +01:00
parent 45fde808d2
commit 123ccde378
6 changed files with 25 additions and 20 deletions
@@ -152,10 +152,9 @@ def symlink_webui_nginx_log(
def get_local_client_version(client: BaseWebClient) -> str | None:
relinfo_file = client.client_dir.joinpath("release_info.json")
version_file = client.client_dir.joinpath(".version")
default = "-"
if not client.client_dir.exists():
return default
return None
# try to get version from release_info.json first
if relinfo_file.is_file():
@@ -177,11 +176,11 @@ def get_local_client_version(client: BaseWebClient) -> str | None:
try:
with open(version_file, "r") as f:
line = f.readline().strip()
return line or default
return line or None
except OSError:
Logger.print_error("Unable to read '.version'")
return default
return None
def get_remote_client_version(client: BaseWebClient) -> str | None: