From b76f26de24c807e1ac6b4f8d431b32213e73d641 Mon Sep 17 00:00:00 2001 From: weifengding Date: Fri, 2 Feb 2018 10:25:34 +0800 Subject: [PATCH] update repositories recursively int sub directories. --- gitup/update.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitup/update.py b/gitup/update.py index 64991eb..39034a2 100644 --- a/gitup/update.py +++ b/gitup/update.py @@ -200,6 +200,11 @@ def _dispatch_multi(base, paths, callback, *args): try: Repo(path) except (exc.InvalidGitRepositoryError, exc.NoSuchPathError): + if os.path.isdir(path): + sub_paths = [os.path.join(path, item) for item in os.listdir(path)] + _dispatch_multi(path, sub_paths, callback, *args) + else: + print(ERROR, BOLD + path, "isn't a repository!") continue valid.append(path)