Skip to content

Instantly share code, notes, and snippets.

@nitindhar7
Created September 9, 2015 15:32
Show Gist options
  • Select an option

  • Save nitindhar7/30f43bea9a6942f30158 to your computer and use it in GitHub Desktop.

Select an option

Save nitindhar7/30f43bea9a6942f30158 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
CODE_PATH = "/path/to/repos"
RUN_PATH = Dir.pwd
IGNORED_DIRS = [".", "..", "temp", "dont-search-in-here"]
Dir.entries(CODE_PATH).select do |f|
begin
if !IGNORED_DIRS.include? f
Dir.chdir("#{CODE_PATH}/#{f}")
has_branch = false
`git branch -a`.split("\n").each do |b|
has_branch = true if b.include? ARGV[0]
end
puts "#{CODE_PATH}/#{f}" if has_branch
end
rescue
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment