mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
feat: add option to create new project in setup_git_home
This commit is contained in:
parent
0d33fcb2be
commit
65cce58b0a
1 changed files with 9 additions and 3 deletions
|
@ -36,8 +36,9 @@ def setup_git_home(io):
|
|||
|
||||
while True:
|
||||
choice = io.prompt_ask(
|
||||
"Enter the number or name of the repository you want to work on,\nor ENTER for a"
|
||||
" new project:"
|
||||
"Enter the number or name of the repository you want to work on,\n"
|
||||
"or enter the name of a new project to create,\n"
|
||||
"or press ENTER for a new project:"
|
||||
)
|
||||
|
||||
if not choice.strip():
|
||||
|
@ -58,7 +59,12 @@ def setup_git_home(io):
|
|||
os.chdir(chosen_repo.parent)
|
||||
return str(chosen_repo.parent)
|
||||
else:
|
||||
io.tool_error("Please enter a valid number or repository name")
|
||||
# Assume it's a new project name
|
||||
project_name = choice
|
||||
new_dir = home / project_name
|
||||
new_dir.mkdir(exist_ok=True)
|
||||
os.chdir(new_dir)
|
||||
return str(new_dir)
|
||||
|
||||
project_name = io.user_input("Enter a name for your new project directory:")
|
||||
new_dir = home / project_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue