lib/shuttle/hook.rb in shuttle-deploy-0.2.3 vs lib/shuttle/hook.rb in shuttle-deploy-0.3.0.beta1
- old
+ new
@@ -2,12 +2,16 @@
class Hook
def initialize(deploy)
@deploy = deploy
end
- def run(commands, allow_failures=false)
+ def run(commands, allow_failures = false)
[commands].flatten.compact.uniq.each do |cmd|
- execute(cmd, allow_failures)
+ if cmd =~ /^task=\s?([A-Za-z\d\_]+)\s?/
+ Shuttle::Task.new(@deploy, $1.strip, allow_failures).run
+ else
+ execute(cmd, allow_failures)
+ end
end
end
private
\ No newline at end of file