From 8793d86d39cc307f7420381b35c403a2a4f61b46 Mon Sep 17 00:00:00 2001 From: dingweifeng <1106628276@qq.com> Date: Thu, 1 Feb 2018 21:58:11 +0800 Subject: [PATCH] process directories recursively --- gitup/update.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitup/update.py b/gitup/update.py index 64991eb..4aecba9 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): + paths = [os.path.join(path, item) for item in os.listdir(path)] + _dispatch_multi(path, paths, callback, *args) + else: + print(ERROR, BOLD + path, "isn't a repository!") continue valid.append(path)