Skip to content

Commit

Permalink
fix: correct windows-style paths on submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
jahwag committed Nov 7, 2024
1 parent d72bfd8 commit 2455f65
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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.6.3"
version = "0.6.4"
authors = [
{name = "Jahziah Wagner", email = "[email protected]"},
]
Expand Down
18 changes: 15 additions & 3 deletions src/claudesync/configmanager/file_config_manager.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
import logging
import os
from datetime import datetime
from pathlib import Path
import logging

from claudesync.configmanager.base_config_manager import BaseConfigManager
from claudesync.session_key_manager import SessionKeyManager
Expand Down Expand Up @@ -85,8 +85,7 @@ def _find_local_config_dir(self, max_depth=100):
def _load_local_config(self):
"""
Loads the local configuration from the nearest .claudesync/config.local.json file.
Sets the local_config_dir and populates the local_config dictionary.
Automatically normalizes any Windows-style paths.
"""
self.local_config_dir = self._find_local_config_dir()
if self.local_config_dir:
Expand All @@ -97,6 +96,19 @@ def _load_local_config(self):
with open(local_config_file, "r") as f:
self.local_config = json.load(f)

# Check and fix Windows-style paths in submodules
if "submodules" in self.local_config:
needs_save = False
for submodule in self.local_config["submodules"]:
if "\\" in submodule["relative_path"]:
submodule["relative_path"] = submodule[
"relative_path"
].replace("\\", "/")
needs_save = True

if needs_save:
self._save_local_config()

def get_local_path(self):
"""
Retrieves the path of the directory containing the .claudesync folder.
Expand Down

0 comments on commit 2455f65

Please sign in to comment.