mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
style: format code with linter
This commit is contained in:
parent
2266f240b1
commit
1eed9dc4e0
1 changed files with 11 additions and 6 deletions
|
@ -21,20 +21,23 @@ from aider.versioncheck import check_version, install_from_main_branch, install_
|
||||||
|
|
||||||
from .dump import dump # noqa: F401
|
from .dump import dump # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
def setup_git_home(io):
|
def setup_git_home(io):
|
||||||
home = Path.home()
|
home = Path.home()
|
||||||
git_repos = list(home.glob("*/.git"))
|
git_repos = list(home.glob("*/.git"))
|
||||||
|
|
||||||
if git_repos:
|
if git_repos:
|
||||||
io.tool_output("Found existing Git repositories in your home directory:")
|
io.tool_output("Found existing Git repositories in your home directory:")
|
||||||
for i, repo in enumerate(git_repos, 1):
|
for i, repo in enumerate(git_repos, 1):
|
||||||
io.tool_output(f"{i}. {repo.parent.name}")
|
io.tool_output(f"{i}. {repo.parent.name}")
|
||||||
|
|
||||||
choice = io.user_input("Enter the number of the repository you want to work on, or 'n' for a new project: ")
|
choice = io.user_input(
|
||||||
|
"Enter the number of the repository you want to work on, or 'n' for a new project: "
|
||||||
|
)
|
||||||
|
|
||||||
if choice.isdigit() and 1 <= int(choice) <= len(git_repos):
|
if choice.isdigit() and 1 <= int(choice) <= len(git_repos):
|
||||||
return str(git_repos[int(choice) - 1].parent)
|
return str(git_repos[int(choice) - 1].parent)
|
||||||
|
|
||||||
project_name = io.user_input("Enter a name for your new project: ")
|
project_name = io.user_input("Enter a name for your new project: ")
|
||||||
new_dir = home / project_name
|
new_dir = home / project_name
|
||||||
new_dir.mkdir(exist_ok=True)
|
new_dir.mkdir(exist_ok=True)
|
||||||
|
@ -77,7 +80,9 @@ def setup_git(git_root, io):
|
||||||
cwd = Path.cwd()
|
cwd = Path.cwd()
|
||||||
if cwd == Path.home():
|
if cwd == Path.home():
|
||||||
git_root = setup_git_home(io)
|
git_root = setup_git_home(io)
|
||||||
elif io.confirm_ask("No git repo found, create one to track aider's changes (recommended)?"):
|
elif io.confirm_ask(
|
||||||
|
"No git repo found, create one to track aider's changes (recommended)?"
|
||||||
|
):
|
||||||
git_root = str(cwd.resolve())
|
git_root = str(cwd.resolve())
|
||||||
repo = git.Repo.init(git_root)
|
repo = git.Repo.init(git_root)
|
||||||
io.tool_output("Git repository created in the current working directory.")
|
io.tool_output("Git repository created in the current working directory.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue