Merge pull request #350 from Boria138/fix-arch-detect

Added checking the /etc/os-release file
This commit is contained in:
Vinícius Moreira
2024-01-30 07:34:41 -03:00
committed by GitHub

View File

@@ -48,6 +48,12 @@ def get_distro():
if os.path.exists('/etc/arch-release'): if os.path.exists('/etc/arch-release'):
return 'arch' 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 os.path.exists('/proc/version'):
if 'ubuntu' in run_cmd('cat /proc/version').lower(): if 'ubuntu' in run_cmd('cat /proc/version').lower():
return 'ubuntu' return 'ubuntu'