Recursive mu register --all
nblock opened this issue · 4 comments
Hi,
I just noticed that mu register --all
only registers propjects within the current directory. Is it also possible to register all projects recursively? Manually registering them works as expected: mu register mygroup/myproject1 mygroup/myproject2
yields:
repo=mygroup/myproject1
repo=mygroup/myproject2
serial=False%
Thx for this fine project!
A workaround might be: find . -maxdepth 2 -type d -exec mu register {} \+
Hi there,
Wouldn't you be interested in implementing that? It should be pretty straightforward (the code is simple).
It should probably be something as mu register --all --maxdepth=2 where the user could specify the depth, and the change would involve changing:
https://github.com/fabioz/mu-repo/blob/master/mu_repo/action_register.py
The single line: args = [repo for repo in os.listdir('.') if isdir(join(repo, '.git'))] should be changed for something which goes recursively adding dirs up to the maxdepth specified (according to the --maxdepth parameter).
Sure, I'll dig into it an open up a PR.
thanks.