diff --git a/src/Types.jl b/src/Types.jl index 6fe0c02d1c..763beb457d 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -178,17 +178,24 @@ function projectfile_path(env_path::String; strict=false) end function manifestfile_path(env_path::String; strict=false) - for name in Base.manifest_names + man_names = @static Base.manifest_names isa Tuple ? Base.manifest_names : Base.manifest_names() + for name in man_names maybe_file = joinpath(env_path, name) isfile(maybe_file) && return maybe_file end if strict return nothing else - project = basename(projectfile_path(env_path)::String) - idx = findfirst(x -> x == project, Base.project_names) - @assert idx !== nothing - return joinpath(env_path, Base.manifest_names[idx]) + n_names = length(man_names) + if n_names == 1 + return joinpath(env_path, only(man_name)) + else + project = basename(projectfile_path(env_path)::String) + idx = findfirst(x -> x == project, Base.project_names) + @assert idx !== nothing + idx = idx + (n_names - length(Base.project_names)) # ignore custom name if present + return joinpath(env_path, man_names[idx]) + end end end