36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/m-git/command/forall.rb', line 36
def execute(argv)
Workspace.check_branch_consistency
Output.puts_start_cmd
for_all_cmd = argv.opt(OPT_LIST[:command]).value
use_concurrent = !argv.opt(OPT_LIST[:concurrent]).nil?
if use_concurrent
succeed_repos, error_repos = Workspace.execute_common_cmd_with_repos_concurrent(for_all_cmd, all_repos)
else
succeed_repos, error_repos = Workspace.execute_common_cmd_with_repos(for_all_cmd, all_repos)
end
no_output_repos = []
succeed_repos.each { |repo_name, output|
if output.length > 0
puts Output.generate_title_block(repo_name) { output } + "\n"
else
no_output_repos.push(repo_name)
end
}
Output.puts_remind_block(no_output_repos, "以上仓库无输出!") if no_output_repos.length > 0
Output.puts_succeed_cmd(argv.absolute_cmd) if error_repos.length == 0
end
|