30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/routes/git_pull.rb', line 30
def git_pull
@git.check_for_same_branch(App::Git::SAME_BRANCH_WARNING)
branch_code = @git.current_branch_for_repo(App::Config.param(App::Config::WORKSTATION_PATH_TO_BP_CODE))
branch_db = @git.current_branch_for_repo(App::Config.param(App::Config::WORKSTATION_PATH_TO_BP_DB))
if App::Terminal::prompt_yes_no("#{App::Terminal::format_action('pull')} the following repos:", [
"#{App::Terminal::format_directory(@git.get_repo_shorthand(App::Config.param(App::Config::WORKSTATION_PATH_TO_BP_CODE)))} will pull #{App::Terminal::format_branch(branch_code)} \xe2\x86\x92 #{App::Terminal::format_branch("origin/#{branch_code}")}",
"#{App::Terminal::format_directory(@git.get_repo_shorthand(App::Config.param(App::Config::WORKSTATION_PATH_TO_BP_DB)))} will pull #{App::Terminal::format_branch(branch_db)} \xe2\x86\x92 #{App::Terminal::format_branch("origin/#{branch_db}")}"
])
@git.check_for_uncommitted_files(true)
@git.repo_loop.each do |repo_dir|
unless App::Terminal::command_capture("git pull origin #{@git.current_branch_for_repo(repo_dir)}", repo_dir)
App::Terminal::warning('Something went wrong', "Not sure what the reason was, but doing a #{App::Terminal::format_command('git pull')} on #{App::Terminal::format_directory(@git.get_repo_shorthand(repo_dir))} was unsuccessful.")
end
end
@git.check_for_stash(true)
end
end
|