mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-10-08 14:05:02 -04:00
fix: auto-detect architecture in main.py if TARGET_ARCH environment variable is missing
CI / build-and-test (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
This commit is contained in:
1 file changed
+7
-2
+7
-2
@@ -42,10 +42,15 @@ SYSTEM_LIBS_DIR = ROOTFS_DIR / "system" / "lib64"
|
||||
DATA_DIR = PROJECT_ROOT / "data"
|
||||
DATA_DIR.mkdir(exist_ok=True)
|
||||
|
||||
import platform
|
||||
|
||||
# Environment settings
|
||||
HTTP_PORT = int(os.getenv("HTTP_PORT", "8080"))
|
||||
TARGET_ARCH = os.getenv("TARGET_ARCH", "arm64-v8a")
|
||||
if TARGET_ARCH == "amd64" or TARGET_ARCH == "x86_64":
|
||||
arch_env = os.getenv("TARGET_ARCH")
|
||||
if not arch_env:
|
||||
arch_env = platform.machine().lower()
|
||||
|
||||
if "x86_64" in arch_env or "amd64" in arch_env:
|
||||
TARGET_ARCH = "x86_64"
|
||||
else:
|
||||
TARGET_ARCH = "arm64-v8a"
|
||||
|
||||
Reference in new issue
Block a user