Added checking the /etc/os-release file

I'm using an arch-based distribution in
which does not have an arch-release file but has an ID_LIKE line in os-release
This commit is contained in:
Boria138
2024-01-23 13:05:11 +06:00
parent 089ed89599
commit 9be612fec6

View File

@@ -48,6 +48,12 @@ def get_distro():
if os.path.exists('/etc/arch-release'):
return 'arch'
if os.path.exists('/etc/os-release'):
with open('/etc/os-release', 'r') as os_release_file:
for line in os_release_file:
if 'ID_LIKE=arch' in line:
return 'arch'
if os.path.exists('/proc/version'):
if 'ubuntu' in run_cmd('cat /proc/version').lower():
return 'ubuntu'