diff options
Diffstat (limited to 'railties/bin')
-rw-r--r-- | railties/bin/switchtower | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/railties/bin/switchtower b/railties/bin/switchtower index 741be775cc..82952a3f20 100644 --- a/railties/bin/switchtower +++ b/railties/bin/switchtower @@ -1,4 +1,15 @@ #!/usr/local/bin/ruby -if not system "switchtower #{ARGV.join(" ")}" - abort "Could not execute switchtower. Is it installed?" + +VENDOR = File.dirname(__FILE__) + "/../vendor" + +$:.unshift "#{VENDOR}/switchtower/lib" + +if File.directory?("#{VENDOR}/rails/switchtower") + $:.unshift "#{VENDOR}/rails/switchtower/lib" + load "#{VENDOR}/rails/switchtower/bin/switchtower" +elsif File.directory?("#{VENDOR}/switchtower") + $:.unshift "#{VENDOR}/switchtower/lib" + load "#{VENDOR}/switchtower/bin/switchtower" +elsif not system "switchtower #{ARGV.join(" ")}" + raise "could not locate switchtower to execute it" end |