Skip to content

Commit

Permalink
env_project_file correctly handle directories
Browse files Browse the repository at this point in the history
On 1.7 and 1.8, if you provide a directory to `env_project_file`, it will return `true` even if there is a project file in the directory.

Note that this PR is against the release-1.8: it was fixed on master by #44318, so we could also backport that one.
  • Loading branch information
simonbyrne committed May 11, 2022
1 parent 3e092a2 commit 63b07da
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 63b07da

Please sign in to comment.