mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix bad logic in determining if in rails app subdir
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
This commit is contained in:
parent
d283ca34a9
commit
b6f9932561
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ module Rails
|
||||||
|
|
||||||
def self.exec_script_rails!
|
def self.exec_script_rails!
|
||||||
cwd = Dir.pwd
|
cwd = Dir.pwd
|
||||||
|
return unless in_rails_application? || in_rails_application_subdirectory?
|
||||||
exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application?
|
exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application?
|
||||||
Dir.chdir("..") do
|
Dir.chdir("..") do
|
||||||
# Recurse in a chdir block: if the search fails we want to be sure
|
# Recurse in a chdir block: if the search fails we want to be sure
|
||||||
|
@ -18,7 +19,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.in_rails_application?
|
def self.in_rails_application?
|
||||||
File.exists?(SCRIPT_RAILS) || in_rails_application_subdirectory?
|
File.exists?(SCRIPT_RAILS)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))
|
def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))
|
||||||
|
|
Loading…
Reference in a new issue