mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
fix: skip interactive dashboard prompt in systemd mode
When running under systemd (ASTRBOT_SYSTEMD=1), the click.confirm() prompt would raise Abort on user input, crashing the service. Skip the interactive confirmation and silently return instead.
This commit is contained in:
@@ -23,10 +23,13 @@ class DashboardManager:
|
||||
match dashboard_version:
|
||||
case None:
|
||||
click.echo("Dashboard is not installed")
|
||||
# Skip interactive prompt when running under systemd
|
||||
if os.environ.get("ASTRBOT_SYSTEMD") == "1":
|
||||
click.echo("Skipping interactive dashboard installation in systemd mode.")
|
||||
return
|
||||
if click.confirm(
|
||||
"Install dashboard?",
|
||||
default=True,
|
||||
abort=True,
|
||||
):
|
||||
click.echo("Installing dashboard...")
|
||||
try:
|
||||
@@ -39,6 +42,8 @@ class DashboardManager:
|
||||
click.echo("Dashboard installed successfully")
|
||||
except Exception as e:
|
||||
click.echo(f"Failed to install dashboard: {e}")
|
||||
else:
|
||||
click.echo("Dashboard installation declined.")
|
||||
|
||||
case str():
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user