Skip to content

Commit d301187

Browse files
committed
bugfix: Fix is in check_git_status passin when doesnt exist
1 parent 1e1da7a commit d301187

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎updater/executor.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def _validate_git_ref(ref: str) -> bool:
6262

6363
def check_git_status(name: str, path: Path | None) -> ComponentStatus:
6464
"""Return a ComponentStatus snapshot for a git-based component."""
65-
if path is None:
66-
return ComponentStatus(name=name, error="path doesnt exist")
65+
if path is None or not path.exists():
66+
return ComponentStatus(name=name, error=f"path {path} does not exist")
6767
status = ComponentStatus(name=name)
6868
result, output = git_fetch(path)
6969
if not result:

‎updater/service.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def _rollback(
126126

127127
async def _run_git_update(self, component: ComponentConfig) -> bool:
128128
"""Run the 5-step git update flow: fetch/pull/pip/deps/restart, rolling back on failure."""
129-
if component.path is None:
129+
if component.path is None or not component.path.exists():
130130
return False
131131
loop = asyncio.get_running_loop()
132132

0 commit comments

Comments
 (0)