diff --git a/.cursorrules b/.cursor/index.mdc similarity index 95% rename from .cursorrules rename to .cursor/index.mdc index 3ebccca..5b9200b 100644 --- a/.cursorrules +++ b/.cursor/index.mdc @@ -1,3 +1,7 @@ +--- +alwaysApply: true +--- + # repo-to-text ## Project Overview diff --git a/AGENTS.md b/AGENTS.md new file mode 120000 index 0000000..94443be --- /dev/null +++ b/AGENTS.md @@ -0,0 +1 @@ +.cursor/index.mdc \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..94443be --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +.cursor/index.mdc \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 19e9e99..ff44c8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "repo-to-text" -version = "0.7.0" +version = "0.8.0" authors = [ { name = "Kirill Markin", email = "markinkirill@gmail.com" }, ] diff --git a/repo_to_text/core/core.py b/repo_to_text/core/core.py index 6dfcda9..b786d8e 100644 --- a/repo_to_text/core/core.py +++ b/repo_to_text/core/core.py @@ -4,6 +4,7 @@ Core functionality for repo-to-text import os import subprocess +import platform from typing import Tuple, Optional, List, Dict, Any, Set from datetime import datetime, timezone from importlib.machinery import ModuleSpec @@ -36,12 +37,20 @@ def get_tree_structure( def run_tree_command(path: str) -> str: """Run the tree command and return its output.""" + if platform.system() == "Windows": + cmd = ["cmd", "/c", "tree", "/a", "/f", path] + else: + cmd = ["tree", "-a", "-f", "--noreport", path] + result = subprocess.run( - ['tree', '-a', '-f', '--noreport', path], + cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + encoding='utf-8', check=True ) - return result.stdout.decode('utf-8') + return result.stdout def filter_tree_output( tree_output: str,