@@ -89,10 +89,10 @@ def guessed_wrong_repo(io, git_root, fnames, git_dname):
8989 return str (check_repo )
9090
9191
92- def make_new_repo (git_root , io ):
92+ async def make_new_repo (git_root , io ):
9393 try :
9494 repo = git .Repo .init (git_root )
95- check_gitignore (git_root , io , False )
95+ await check_gitignore (git_root , io , False )
9696 except ANY_GIT_ERROR as err : # issue #1233
9797 io .tool_error (f"Unable to create git repo in { git_root } " )
9898 io .tool_output (str (err ))
@@ -102,7 +102,7 @@ def make_new_repo(git_root, io):
102102 return repo
103103
104104
105- def setup_git (git_root , io ):
105+ async def setup_git (git_root , io ):
106106 if git is None :
107107 return
108108
@@ -123,11 +123,11 @@ def setup_git(git_root, io):
123123 "You should probably run aider in your project's directory, not your home dir."
124124 )
125125 return
126- elif cwd and io .confirm_ask (
126+ elif cwd and await io .confirm_ask (
127127 "No git repo found, create one to track aider's changes (recommended)?"
128128 ):
129129 git_root = str (cwd .resolve ())
130- repo = make_new_repo (git_root , io )
130+ repo = await make_new_repo (git_root , io )
131131
132132 if not repo :
133133 return
@@ -156,7 +156,7 @@ def setup_git(git_root, io):
156156 return repo .working_tree_dir
157157
158158
159- def check_gitignore (git_root , io , ask = True ):
159+ async def check_gitignore (git_root , io , ask = True ):
160160 if not git_root :
161161 return
162162
@@ -192,7 +192,9 @@ def check_gitignore(git_root, io, ask=True):
192192
193193 if ask :
194194 io .tool_output ("You can skip this check with --no-gitignore" )
195- if not io .confirm_ask (f"Add { ', ' .join (patterns_to_add )} to .gitignore (recommended)?" ):
195+ if not await io .confirm_ask (
196+ f"Add { ', ' .join (patterns_to_add )} to .gitignore (recommended)?"
197+ ):
196198 return
197199
198200 content += "\n " .join (patterns_to_add ) + "\n "
@@ -209,16 +211,16 @@ def check_gitignore(git_root, io, ask=True):
209211 io .tool_output (f" { pattern } " )
210212
211213
212- def check_streamlit_install (io ):
213- return utils .check_pip_install_extra (
214+ async def check_streamlit_install (io ):
215+ return await utils .check_pip_install_extra (
214216 io ,
215217 "streamlit" ,
216218 "You need to install the aider browser feature" ,
217219 ["aider-ce[browser]" ],
218220 )
219221
220222
221- def write_streamlit_credentials ():
223+ async def write_streamlit_credentials ():
222224 from streamlit .file_util import get_streamlit_file_path
223225
224226 # See https://github.com/Aider-AI/aider/issues/772
@@ -722,7 +724,7 @@ def get_io(pretty):
722724 " personal info."
723725 )
724726 io .tool_output (f"For more info: { urls .analytics } " )
725- disable = not io .confirm_ask (
727+ disable = not await io .confirm_ask (
726728 "Allow collection of anonymous analytics to help improve aider?"
727729 )
728730
@@ -740,7 +742,7 @@ def get_io(pretty):
740742 analytics .event ("launched" )
741743
742744 if args .gui and not return_coder :
743- if not check_streamlit_install (io ):
745+ if not await check_streamlit_install (io ):
744746 analytics .event ("exit" , reason = "Streamlit not installed" )
745747 return
746748 analytics .event ("gui session" )
@@ -807,22 +809,22 @@ def get_io(pretty):
807809 return 0 if not update_available else 1
808810
809811 if args .install_main_branch :
810- success = install_from_main_branch (io )
812+ success = await install_from_main_branch (io )
811813 analytics .event ("exit" , reason = "Installed main branch" )
812814 return 0 if success else 1
813815
814816 if args .upgrade :
815- success = install_upgrade (io )
817+ success = await install_upgrade (io )
816818 analytics .event ("exit" , reason = "Upgrade completed" )
817819 return 0 if success else 1
818820
819821 if args .check_update :
820822 check_version (io , verbose = args .verbose )
821823
822824 if args .git :
823- git_root = setup_git (git_root , io )
825+ git_root = await setup_git (git_root , io )
824826 if args .gitignore :
825- check_gitignore (git_root , io )
827+ await check_gitignore (git_root , io )
826828
827829 if args .verbose :
828830 show = format_settings (parser , args )
@@ -970,7 +972,7 @@ def get_io(pretty):
970972 return 1
971973
972974 if args .show_model_warnings :
973- problem = models .sanity_check_models (io , main_model )
975+ problem = await models .sanity_check_models (io , main_model )
974976 if problem :
975977 analytics .event ("model warning" , main_model = main_model )
976978 io .tool_output ("You can skip this check with --no-show-model-warnings" )
0 commit comments