Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Support splitting on commas
  • Loading branch information
tpope committed Mar 3, 2013
1 parent 8aa6400 commit be2d524
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.markdown
Expand Up @@ -12,7 +12,11 @@ Run a command across multiple apps by including `*` in the app name.
web.1: up 2013/03/02 11:53:30 (~ 9h ago)
web.2: up 2013/03/02 11:56:05 (~ 9h ago)

You can also match against the Git remote name:
You can also use commas for more precise specification:

$ heroku maintenance:on -a thing1,thing2

Or match against the Git remote name:

$ heroku info -r*

Expand Down
4 changes: 2 additions & 2 deletions init.rb
Expand Up @@ -37,14 +37,14 @@ def run(cmd, original_args=[])
pattern = git("config heroku.remote")[/.+/]
end

if pattern.to_s.include?('*')
if pattern.to_s.include?('*') || pattern.to_s.include?(',')
found = false
if option == '--remote'
Heroku::Command::Base.allocate.send(:git_remotes).to_a
else
Heroku::Auth.api.get_apps.body.map { |a| [a['name'], a['name']] }
end.each do |candidate, app|
if File.fnmatch?(pattern, candidate)
if pattern.split(',').any? { |glob| File.fnmatch?(glob, candidate) }
found = true
if $stdout.tty? && ENV['TERM'] != 'dumb'
display("\e[01m# #{app}\e[00m")
Expand Down

0 comments on commit be2d524

Please sign in to comment.