Skip to content

Commit

Permalink
fix: exclude ~/.claudesync from _find_local_config_dir results
Browse files Browse the repository at this point in the history
  • Loading branch information
jahwag committed Sep 12, 2024
1 parent 06c50fb commit d1bb4cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "claudesync"
version = "0.5.6"
version = "0.5.7"
authors = [
{name = "Jahziah Wagner", email = "[email protected]"},
]
Expand Down
6 changes: 4 additions & 2 deletions src/claudesync/configmanager/file_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ def _find_local_config_dir(self, max_depth=100):
Finds the nearest directory containing a .claudesync folder.
Searches from the current working directory upwards until it finds a .claudesync folder
or reaches the root directory.
or reaches the root directory. Excludes the ~/.claudesync directory.
Returns:
Path: The path containing the .claudesync folder, or None if not found.
"""
current_dir = Path.cwd()
root_dir = Path(current_dir.root)
home_dir = Path.home()
depth = 0 # Initialize depth counter

while current_dir != root_dir:
if (current_dir / ".claudesync").is_dir():
claudesync_dir = current_dir / ".claudesync"
if claudesync_dir.is_dir() and claudesync_dir != home_dir / ".claudesync":
return current_dir

current_dir = current_dir.parent
Expand Down

0 comments on commit d1bb4cf

Please sign in to comment.