Update install.py
This commit is contained in:
25
install.py
25
install.py
@@ -1,22 +1,23 @@
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
is_linux = false
|
||||
is_macos = false
|
||||
is_windows = false
|
||||
|
||||
def check_os():
|
||||
"""Checks the operating system and prints a message accordingly."""
|
||||
os_type = platform.uname().sysname.lower()
|
||||
|
||||
os_type = os.uname().sysname.lower()
|
||||
is_linux = os_type == "linux"
|
||||
is_macos = os_type == "darwin"
|
||||
is_windows = os_type == "windows"
|
||||
|
||||
if os_type == "linux":
|
||||
print("Running on Linux")
|
||||
elif os_type == "darwin":
|
||||
print("Running on macOS")
|
||||
if is_linux or is_macos or is_windows:
|
||||
print(f"Running on {os_type}")
|
||||
else:
|
||||
print(f"Unsupported OS family: {os_type}")
|
||||
return 1 # Indicate an error
|
||||
|
||||
return 0 # Indicate success
|
||||
exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit_code = check_os()
|
||||
sys.exit(exit_code)
|
||||
check_os()
|
||||
|
||||
Reference in New Issue
Block a user