From fe6e30ed51d3f6d48da3f3b60ffb1da438f03f62 Mon Sep 17 00:00:00 2001 From: mastercoms Date: Sat, 22 May 2021 13:28:59 -0400 Subject: [PATCH] auto accept prompt on windows --- pbsync/pbsync.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pbsync/pbsync.py b/pbsync/pbsync.py index 70325e4..c7c2c0f 100644 --- a/pbsync/pbsync.py +++ b/pbsync/pbsync.py @@ -58,10 +58,13 @@ def sync_handler(sync_val: str, repository_val=None, requested_bundle_name=None) needs_git_update = True if sys.platform == "win32" or sys.platform == "darwin": pblog.info("Attempting auto-update of Git...") - proc = pbtools.run([pbgit.get_git_executable(), "update-microsoft-git"]) + if sys.platform == "win32": + proc = pbtools.run([pbgit.get_git_executable(), "upgrade-git-for-windows", "-y"]) + else: + proc = pbtools.run([pbgit.get_git_executable(), "update-microsoft-git"]) # if non-zero, error out if proc.returncode: - pblog.error(proc.out) + pblog.warning("Git auto-update failed. Please try manually:") else: needs_git_update = False input("Launching Git update, please press enter when done installing. ")