Class: Pixab::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/git/Git.rb

Instance Method Summary collapse

Instance Method Details

#run(commands) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/git/Git.rb', line 7

def run(commands)
  git_repos = UserInfo.new.git_repos
  if git_repos.empty?
    puts "No Git repositories found.".red
    return
  end

  command = commands.join(' ')
  git_repos.each do |repo|
    puts "\n[#{File.basename(repo)}]".green
    Dir.chdir(repo) do
      system command
    end
  end

end