mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
fix: handle directory creation errors in setup_git_home
This commit is contained in:
parent
2192a5efb2
commit
a57d9e55d6
2 changed files with 42 additions and 8 deletions
|
@ -58,15 +58,23 @@ def setup_git_home(io):
|
|||
# Assume it's a new project name
|
||||
project_name = choice
|
||||
new_dir = home / project_name
|
||||
new_dir.mkdir(parents=True, exist_ok=True)
|
||||
os.chdir(new_dir)
|
||||
return str(new_dir)
|
||||
try:
|
||||
new_dir.mkdir(parents=True, exist_ok=True)
|
||||
os.chdir(new_dir)
|
||||
return str(new_dir)
|
||||
except OSError as e:
|
||||
io.tool_error(f"Error creating directory: {e}")
|
||||
return None
|
||||
|
||||
project_name = io.user_input("Enter a name for your new project directory:")
|
||||
new_dir = home / project_name
|
||||
new_dir.mkdir(parents=True, exist_ok=True)
|
||||
os.chdir(new_dir)
|
||||
return str(new_dir)
|
||||
try:
|
||||
new_dir.mkdir(parents=True, exist_ok=True)
|
||||
os.chdir(new_dir)
|
||||
return str(new_dir)
|
||||
except OSError as e:
|
||||
io.tool_error(f"Error creating directory: {e}")
|
||||
return None
|
||||
|
||||
|
||||
def get_git_root():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue