Skip to content

Commit

Permalink
Fix issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed Jan 20, 2012
1 parent dac11ff commit baf1c04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/do/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def servers

def remotes
@_remotes ||= begin
name = ARGV[0]
servers.select { |s| s.name.to_s == name } + servers.select { |s| s.role.to_s == name }
names = ARGV[0].split('+')
servers.select { |s| names.include?(s.name.to_s) } | servers.select { |s| names.include?(s.role.to_s) }
end
end
alias :remote :remotes
Expand Down Expand Up @@ -107,11 +107,11 @@ def server(name, host, user, options={})
set current.name, current
set current.role, servers.select { |s| s.role == current.role } if current.role
task name do |opts, b|
@_current_server = servers.find { |s| s.name == current.name }
server_was, @_current_server = @_current_server, servers.find { |s| s.name == current.name }
begin
b.arity == 1 ? b.call(opts) : b.call
ensure
@_current_server = nil
@_current_server = server_was
end
end
end
Expand Down

0 comments on commit baf1c04

Please sign in to comment.