Skip to content

Instantly share code, notes, and snippets.

@raldred
Created February 26, 2020 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raldred/e5f3bad6be15188e6262151976378766 to your computer and use it in GitHub Desktop.
Save raldred/e5f3bad6be15188e6262151976378766 to your computer and use it in GitHub Desktop.
Quick script to check the stack of all our apps
#!/usr/bin/env ruby
team = ARGV[0]
raise 'Specify team' unless team
check_app = Proc.new do |app|
info = %x{heroku apps:info -a #{app}}
stack = info.match(/Stack:\s+(.*)/)[1].strip
app = "#{app}:"
puts "#{app.ljust(30)} #{stack}"
end
check_app.call(ARGV[0]) && return if ARGV[0]
def all_apps(team)
apps = %x{heroku apps -t #{team}}
apps.scan(/^([\w-]+)/).flatten
end
apps = all_apps(team)
apps.each(&check_app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment