Skip to content

Commit

Permalink
fix bad logic in determining if in rails app subdir
Browse files Browse the repository at this point in the history
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information
chad authored and dhh committed Jul 26, 2010
1 parent d283ca3 commit b6f9932
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails/script_rails_loader.rb
Expand Up @@ -7,6 +7,7 @@ module ScriptRailsLoader

def self.exec_script_rails!
cwd = Dir.pwd
return unless in_rails_application? || in_rails_application_subdirectory?
exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application?
Dir.chdir("..") do
# Recurse in a chdir block: if the search fails we want to be sure
Expand All @@ -18,7 +19,7 @@ def self.exec_script_rails!
end

def self.in_rails_application?
File.exists?(SCRIPT_RAILS) || in_rails_application_subdirectory?
File.exists?(SCRIPT_RAILS)
end

def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))
Expand Down

0 comments on commit b6f9932

Please sign in to comment.