mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-08 13:44:59 +00:00
feat: Add export command and create timestamp directory
This commit is contained in:
parent
74ecdf2d3f
commit
afefb6b2d5
2 changed files with 20 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,3 +16,4 @@ aider/_version.py
|
||||||
.#*
|
.#*
|
||||||
.gitattributes
|
.gitattributes
|
||||||
tmp.benchmarks/
|
tmp.benchmarks/
|
||||||
|
.qodo
|
||||||
|
|
|
@ -1413,7 +1413,6 @@ class Commands:
|
||||||
|
|
||||||
def cmd_copy_context(self, args=None):
|
def cmd_copy_context(self, args=None):
|
||||||
"""Copy the current chat context as markdown, suitable to paste into a web UI"""
|
"""Copy the current chat context as markdown, suitable to paste into a web UI"""
|
||||||
|
|
||||||
chunks = self.coder.format_chat_chunks()
|
chunks = self.coder.format_chat_chunks()
|
||||||
|
|
||||||
markdown = ""
|
markdown = ""
|
||||||
|
@ -1455,6 +1454,24 @@ Just show me the edits I need to make.
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.io.tool_error(f"An unexpected error occurred while copying to clipboard: {str(e)}")
|
self.io.tool_error(f"An unexpected error occurred while copying to clipboard: {str(e)}")
|
||||||
|
|
||||||
|
def _create_export_directory(self):
|
||||||
|
"""Create and return a timestamped directory for exports"""
|
||||||
|
from datetime import datetime
|
||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
timestamp = datetime.now().strftime("%Y-%m-%d_%H%M%S")
|
||||||
|
export_dir = os.path.join(tempfile.gettempdir(), f"export_{timestamp}")
|
||||||
|
os.makedirs(export_dir, exist_ok=True)
|
||||||
|
return export_dir
|
||||||
|
|
||||||
|
def cmd_export_context(self, args):
|
||||||
|
"Export files in chat context to a timestamped directory"
|
||||||
|
|
||||||
|
export_dir = self._create_export_directory()
|
||||||
|
self.io.tool_output(f"Created directory: {export_dir}")
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def expand_subdir(file_path):
|
def expand_subdir(file_path):
|
||||||
if file_path.is_file():
|
if file_path.is_file():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue