fix(shell): check if system is Linux before check for os_release

Why this change ?
=================

On Windows or MacOS, Cutekit will crash because it cannot access Linux distro informations available
inside of the /etc directory

The fix
=======

A simple check if the system is Linux should do the job.
This commit is contained in:
Jordan ⌨️ 2024-02-23 18:45:42 +01:00
parent 220f15008b
commit 5ffa1868e3

View file

@ -32,7 +32,7 @@ class Uname:
def uname() -> Uname:
un = platform.uname()
if hasattr(platform, "freedesktop_os_release"):
if un.system == "Linux" and hasattr(platform, "freedesktop_os_release"):
distrib = platform.freedesktop_os_release()
else:
distrib = {"NAME": "Unknown"}