feat(mma): Implement TrackDAG for dependency resolution and cycle detection
This commit is contained in:
@@ -99,8 +99,19 @@ def _is_allowed(path: Path) -> bool:
|
||||
rp = path.resolve(strict=True)
|
||||
except (OSError, ValueError):
|
||||
rp = path.resolve()
|
||||
|
||||
if rp in _allowed_paths:
|
||||
return True
|
||||
|
||||
# Allow current working directory and subpaths by default if no base_dirs
|
||||
cwd = Path.cwd().resolve()
|
||||
if not _base_dirs:
|
||||
try:
|
||||
rp.relative_to(cwd)
|
||||
return True
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
for bd in _base_dirs:
|
||||
try:
|
||||
rp.relative_to(bd)
|
||||
|
||||
Reference in New Issue
Block a user