Skip to content

Commit

Permalink
Проверка на platform
Browse files Browse the repository at this point in the history
  • Loading branch information
0Nera authored Oct 22, 2023
1 parent 67d90b8 commit dc0a4ca
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import shutil
import subprocess
import time
import platform
from multiprocessing import Pool


Expand Down Expand Up @@ -96,13 +95,19 @@ def check_limine():


def check_os():
current_os = platform.system().lower()

if current_os == 'linux':
dist = platform.linux_distribution()[0].lower()

if dist == 'ubuntu' or dist == 'debian':
return 1
import platform
using_distro = False
try:
import distro
using_distro = True
except ImportError:
pass
if using_distro:
linux_distro = distro.like()
else:
linux_distro = platform.linux_distribution()[0]
if linux_distro.lower( in ['debian', 'ubuntu']:
return 1
return 0

def check_tools():
Expand Down

0 comments on commit dc0a4ca

Please sign in to comment.