Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix bad logic in determining if in rails app subdir

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information...
commit b6f99325613baf0534c10677da9c82ac27b628c0 1 parent d283ca3
Chad Fowler chad authored dhh committed

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  railties/lib/rails/script_rails_loader.rb
3  railties/lib/rails/script_rails_loader.rb
@@ -7,6 +7,7 @@ module ScriptRailsLoader
7 7
8 8 def self.exec_script_rails!
9 9 cwd = Dir.pwd
  10 + return unless in_rails_application? || in_rails_application_subdirectory?
10 11 exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application?
11 12 Dir.chdir("..") do
12 13 # Recurse in a chdir block: if the search fails we want to be sure
@@ -18,7 +19,7 @@ def self.exec_script_rails!
18 19 end
19 20
20 21 def self.in_rails_application?
21   - File.exists?(SCRIPT_RAILS) || in_rails_application_subdirectory?
  22 + File.exists?(SCRIPT_RAILS)
22 23 end
23 24
24 25 def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))

0 comments on commit b6f9932

Please sign in to comment.
Something went wrong with that request. Please try again.