Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/mrgnw/scripts.
Something went wrong. Try again.
1234567891011121314151617181920212223from pathlib import Pathfrom git import Repofrom concurrent.futures import ThreadPoolExecutorfrom tqdm import tqdm
def update_repo(repo_path): repo = Repo(repo_path) repo.remotes.origin.pull()
def main(): repo_folder = Path().cwd() repos = [repo_path for repo_path in repo_folder.iterdir() if repo_path.is_dir()]
with ThreadPoolExecutor() as executor: futures = [executor.submit(update_repo, repo) for repo in repos]
with tqdm(total=len(futures), ncols=80, desc="Updating repositories") as pbar: for future in futures: future.result() pbar.update(1)
if __name__ == '__main__': main()