diff --git a/backend/routers/updates.py b/backend/routers/updates.py index 8fb9541..9ad2cee 100644 --- a/backend/routers/updates.py +++ b/backend/routers/updates.py @@ -16,7 +16,20 @@ router = APIRouter(prefix="/api/updates", tags=["updates"]) # --------------------------------------------------------------------------- _IS_GIT = (BASE_DIR / ".git").is_dir() -_HAS_GIT = bool(shutil.which("git")) + + +def _find_git() -> bool: + """Check if git is available, even with systemd's minimal PATH.""" + if shutil.which("git"): + return True + # systemd services often have a stripped PATH — check common locations + for p in ("/usr/bin/git", "/usr/local/bin/git", "/bin/git"): + if os.path.isfile(p) and os.access(p, os.X_OK): + return True + return False + + +_HAS_GIT = _find_git() def _require_git(): diff --git a/frontend/js/atlus.js b/frontend/js/atlus.js index 2ce6800..9b0ea82 100644 --- a/frontend/js/atlus.js +++ b/frontend/js/atlus.js @@ -397,7 +397,7 @@ if (updateDismissed) return; try { const res = await Atlus.apiFetch('/api/updates/check'); - if (!res.ok) return; + if (!res || !res.ok) return; const data = await res.json(); const panel = $('#panelUpdates'); if (!panel) return;