mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-13 20:28:21 +10:00
16 lines
505 B
Python
16 lines
505 B
Python
from __future__ import print_function
|
|
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
|
|
models = json.load(open("models.json"))
|
|
|
|
current_model = subprocess.Popen("system_profiler SPHardwareDataType".split(), stdout=subprocess.PIPE)
|
|
current_model = [line.strip().split(": ", 1)[1] for line in current_model.stdout.read().split("\n") if line.strip().startswith("Model Identifier")][0]
|
|
print(current_model)
|
|
|
|
if current_model not in models:
|
|
print("Your model is not supported by this patcher!")
|
|
sys.exit(1)
|