diff --git a/aider/main.py b/aider/main.py index 73f25068d..eb7ce70d6 100644 --- a/aider/main.py +++ b/aider/main.py @@ -6,6 +6,7 @@ from dotenv import load_dotenv from aider.coder import Coder from aider.io import InputOutput + def get_git_root(): try: repo = git.Repo(search_parent_directories=True) @@ -14,7 +15,6 @@ def get_git_root(): return None - def main(args=None, input=None, output=None): if args is None: args = sys.argv[1:] @@ -22,13 +22,12 @@ def main(args=None, input=None, output=None): load_dotenv() env_prefix = "AIDER_" - git_root = get_git_root() - if git_root: - default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml")) - default_config_files = [ os.path.expanduser("~/.aider.conf.yml"), ] + git_root = get_git_root() + if git_root: + default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml")) parser = configargparse.ArgumentParser( description="aider - chat with GPT about your code",