class Git::Multiple::CLI

Public Instance Methods

manupulate() click to toggle source
# File lib/git/multiple/cli.rb, line 18
def manupulate
  base_dir = options[:dirname]
  git_command = options[:exec]
  directories = find_dir(base_dir, options[:maxdepth])
  Git::Multiple::PrallelTask.start(directories, git_command, options)
end

Private Instance Methods

find_dir(base_dir, maxdepth) click to toggle source
# File lib/git/multiple/cli.rb, line 28
def find_dir(base_dir, maxdepth)
  result = []
  Find.find(base_dir) do |f|
    fname = File.expand_path(f)
    Find.prune if fname.match %r<^#{base_dir}(?:/.*){#{maxdepth.to_i + 2}}>
    Find.prune if File.exists?("#{File.dirname(fname)}/.git-parallel-skip")
    result.push(File.dirname(fname)) if File.basename(fname) == ".git"
  end
  return result
end