Skip to content

Commit fd3aad7

Browse files
committed
tests: add more e2e tests
1 parent 0827bf4 commit fd3aad7

2 files changed

Lines changed: 296 additions & 116 deletions

File tree

src/cocoindex_code/cli.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,7 @@ def reset(
392392
_typer.echo("Aborted.")
393393
raise _typer.Exit(code=0)
394394

395-
# Delete files
396-
for f in to_delete:
397-
f.unlink(missing_ok=True)
398-
399-
# Remove project from daemon (without auto-starting)
395+
# Remove project from daemon first so it releases file handles
400396
try:
401397
from .client import DaemonClient
402398

@@ -407,6 +403,15 @@ def reset(
407403
except (ConnectionRefusedError, OSError, RuntimeError):
408404
pass # Daemon not running — that's fine
409405

406+
# Delete files/directories
407+
import shutil as _shutil
408+
409+
for f in to_delete:
410+
if f.is_dir():
411+
_shutil.rmtree(f)
412+
else:
413+
f.unlink(missing_ok=True)
414+
410415
if all_:
411416
# Remove .cocoindex_code/ if empty
412417
try:

0 commit comments

Comments
 (0)