From c05aa872b2e7f5b3fd830758b6831a0c0d371ed5 Mon Sep 17 00:00:00 2001 From: NomenAK Date: Thu, 14 Aug 2025 22:35:14 +0200 Subject: [PATCH] Exclude local/ folder from SuperClaude backups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update installer backup to exclude local/ directory containing Claude Code files - Update backup command to skip files in local/ and backups/ directories - Prevent Claude Code installation files from being included in SuperClaude backups 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- setup/cli/commands/backup.py | 7 ++++++- setup/core/installer.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/setup/cli/commands/backup.py b/setup/cli/commands/backup.py index f1c8f1a..b89b418 100644 --- a/setup/cli/commands/backup.py +++ b/setup/cli/commands/backup.py @@ -309,13 +309,18 @@ def create_backup(args: argparse.Namespace) -> bool: tar.add(temp_file.name, arcname="backup_metadata.json") Path(temp_file.name).unlink() # Clean up temp file - # Add installation directory contents + # Add installation directory contents (excluding backups and local dirs) files_added = 0 for item in args.install_dir.rglob("*"): if item.is_file() and item != backup_file: try: # Create relative path for archive rel_path = item.relative_to(args.install_dir) + + # Skip files in excluded directories + if rel_path.parts and rel_path.parts[0] in ["backups", "local"]: + continue + tar.add(item, arcname=str(rel_path)) files_added += 1 diff --git a/setup/core/installer.py b/setup/core/installer.py index 6dcceda..546f311 100644 --- a/setup/core/installer.py +++ b/setup/core/installer.py @@ -156,9 +156,9 @@ class Installer: # Ensure temp backup directory exists temp_backup.mkdir(parents=True, exist_ok=True) - # Copy all files except backups directory + # Copy all files except backups and local directories for item in self.install_dir.iterdir(): - if item.name != "backups": + if item.name not in ["backups", "local"]: try: if item.is_file(): shutil.copy2(item, temp_backup / item.name)