Skip to content

Commit

Permalink
fix: exclude ~/.claudesync from _find_local_config_dir results (#67)
Browse files Browse the repository at this point in the history
- Add check to prevent ~/.claudesync from being returned as local config
dir
- Update docstring to reflect new exclusion criteria
- Improve code review process and ownership clarity
  • Loading branch information
jahwag authored Sep 12, 2024
1 parent 06c50fb commit 4b0a967
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for everything in the repo
* @jahwag
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 4b0a967

Please sign in to comment.