Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ function env_project_file(env::String)::Union{Bool,String}
project_file === nothing || return project_file
end
if isdir(env)
project_file = true
for proj in project_names
maybe_project_file = joinpath(env, proj)
if isfile_casesensitive(maybe_project_file)
project_file = maybe_project_file
break
end
end
project_file =true
elseif basename(env) in project_names && isfile_casesensitive(env)
project_file = env
else
Expand Down
11 changes: 11 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ end
[deps]
This = "$this_uuid"
""")

@test Base.env_project_file(joinpath(dir)) == project_file
@test Base.env_project_file(joinpath(project_file)) == project_file

@test Base.env_project_file(joinpath(dir, "This")) === false
@test Base.env_project_file(joinpath(project_file, "This")) === false

mkdir(joinpath(dir, "Inner"))
@test Base.env_project_file(joinpath(dir, "Inner")) === true
@test Base.env_project_file(joinpath(dir, "Inner", "Project.toml")) === false

# look up various packages by name
root = Base.identify_package("Root")
this = Base.identify_package("This")
Expand Down