From 4fd77ea008e3650a41c55f1478794722bb4ca146 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Fri, 20 Mar 2026 19:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=93=BE=EF=BC=8C=E5=8F=82=E6=95=B0/=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/cli/commands/cmd_run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/cli/commands/cmd_run.py b/astrbot/cli/commands/cmd_run.py index 7122c0d4a..89a3ba269 100644 --- a/astrbot/cli/commands/cmd_run.py +++ b/astrbot/cli/commands/cmd_run.py @@ -218,6 +218,8 @@ def run( # Mark CLI execution os.environ["ASTRBOT_CLI"] = "1" + from astrbot.core.utils.astrbot_path import astrbot_paths + # Resolve astrbot_root with the following precedence: # 1. CLI --root parameter (local variable `root`) # 2. ASTRBOT_ROOT environment variable (possibly from .env or parsed service config) @@ -228,8 +230,6 @@ def run( elif os.environ.get("ASTRBOT_ROOT"): astrbot_root = Path(os.environ["ASTRBOT_ROOT"]) else: - from astrbot.core.utils.astrbot_path import astrbot_paths - astrbot_root = astrbot_paths.root if not astrbot_paths.is_root: