Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exclude ~/.claudesync from _find_local_config_dir results #67

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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