Skip to content

Instantly share code, notes, and snippets.

@shawn42
Created August 26, 2009 14:18
Show Gist options
  • Save shawn42/175526 to your computer and use it in GitHub Desktop.
Save shawn42/175526 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
P4_EDMUNDS = "/Users/sanderson/use_the_force/edmunds"
project_dirs = ARGV
project_dirs = %w| sites services libraries | if project_dirs.empty?
out = $stdout
Dir.chdir P4_EDMUNDS
project_dirs.each do |dir|
# find all projects w/ a main dir
main_dirs = File.join dir, "**[^main]", "main"
dirs = Dir.glob main_dirs
dirs.each do |main_dir|
cmd = "cd #{main_dir} && mvn dependency:tree"
results = `#{cmd}`
out.puts "[#{cmd}: #{$?}"
if $?.exitstatus == 0
out.write '.'
out.flush
else
out.puts ""
results.each do |output|
out.puts output
end
out.puts "Project at #{main_dir} failed, see above for details"
out.flush
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment