Update install.py
This commit is contained in:
25
install.py
25
install.py
@@ -1,22 +1,23 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import platform
|
||||||
|
|
||||||
|
is_linux = false
|
||||||
|
is_macos = false
|
||||||
|
is_windows = false
|
||||||
|
|
||||||
def check_os():
|
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":
|
if is_linux or is_macos or is_windows:
|
||||||
print("Running on Linux")
|
print(f"Running on {os_type}")
|
||||||
elif os_type == "darwin":
|
|
||||||
print("Running on macOS")
|
|
||||||
else:
|
else:
|
||||||
print(f"Unsupported OS family: {os_type}")
|
print(f"Unsupported OS family: {os_type}")
|
||||||
return 1 # Indicate an error
|
exit(1)
|
||||||
|
|
||||||
return 0 # Indicate success
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
exit_code = check_os()
|
check_os()
|
||||||
sys.exit(exit_code)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user