Skip to content

Commit

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


Expand Down Expand Up @@ -93,6 +94,17 @@ def check_limine():
os.chdir("..")



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
return 0

def check_tools():
required_tools = ["gcc", "g++", "xorriso", "make", "mtools", "curl"]
missing_tools = []
Expand All @@ -102,7 +114,9 @@ def check_tools():
missing_tools.append(tool)

if len(missing_tools) > 0:
subprocess.run(["sudo", "apt", "install"] + missing_tools)
if check_os():
subprocess.run(["sudo", "apt", "install"] + missing_tools)
return
subprocess.run(["sudo", "pacman", "-S"] + missing_tools)


Expand Down Expand Up @@ -165,4 +179,4 @@ def create_iso(IMAGE_NAME):
create_iso("bmosp")
create_hdd("bmosp")

print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}")
print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}")

0 comments on commit 67d90b8

Please sign in to comment.