From 21b78f0369b75f8d6144a0b36b778db7b28392be Mon Sep 17 00:00:00 2001 From: jonathan Date: Wed, 15 Oct 2025 21:06:42 +0000 Subject: [PATCH] Update install.py --- install.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/install.py b/install.py index 23872b5..8f21ff4 100644 --- a/install.py +++ b/install.py @@ -1,22 +1,22 @@ import os import platform -def get_os_type(): return platform.uname().system.lower() +os_type = platform.uname().system.lower() -def is_linux(): return get_os_type() == "linux" -def is_macos(): return get_os_type() == "darwin" -def is_windows(): return get_os_type() == "windows" +is_linux = os_type == "linux" +is_macos = os_type == "darwin" +is_windows = os_type == "windows" -def is_debian(): return os.system('apt --version > /dev/null 2>&1') >> 8 == 0 -def is_rhel(): return os.system('dnf --version > /dev/null 2>&1') >> 8 == 0 +is_debian = os.system('apt --version > /dev/null 2>&1') >> 8 == 0 +is_rhel = os.system('dnf --version > /dev/null 2>&1') >> 8 == 0 def check_os(): - if is_linux() or is_macos() or is_windows(): - print(f"Running on {get_os_type()}") + if is_linux or is_macos or is_windows: + print(f"Running on {os_type}") else: - print(f"Unsupported OS family: {get_os_type()}") + print(f"Unsupported OS family: {os_type}") exit(1) if __name__ == "__main__": check_os() - print(f'is_windows: {is_windows()}, is_macos: {is_macos()}, is_linux: {is_linux()}, is_debian: {is_debian()}, is_rhel: {is_rhel()}') \ No newline at end of file + print(f'is_windows: {is_windows}, is_macos: {is_macos}, is_linux: {is_linux}, is_debian: {is_debian}, is_rhel: {is_rhel}') \ No newline at end of file