Skip to content

Commit 7e96bc2

Browse files
committed
fix: 🐛 Fix path error
1 parent ec5f0da commit 7e96bc2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

codelimit/commands/check.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ def check_command(paths: list[Path], quiet: bool):
2424
dirs[:] = [d for d in dirs if not d[0] == "."]
2525
for file in files:
2626
abs_path = Path(os.path.join(root, file))
27-
rel_path = abs_path.relative_to(Path.cwd())
27+
if abs_path.is_relative_to(Path.cwd()):
28+
rel_path = abs_path.relative_to(Path.cwd())
29+
else:
30+
rel_path = abs_path
2831
if is_excluded(rel_path, excludes_spec):
2932
continue
3033
check_file(abs_path, check_result)

0 commit comments

Comments
 (0)