Skip to content

Commit 3aa1505

Browse files
Handle custom manifest name (#3000)
1 parent 2b78a74 commit 3aa1505

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Types.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,24 @@ function projectfile_path(env_path::String; strict=false)
178178
end
179179

180180
function manifestfile_path(env_path::String; strict=false)
181-
for name in Base.manifest_names
181+
man_names = @static Base.manifest_names isa Tuple ? Base.manifest_names : Base.manifest_names()
182+
for name in man_names
182183
maybe_file = joinpath(env_path, name)
183184
isfile(maybe_file) && return maybe_file
184185
end
185186
if strict
186187
return nothing
187188
else
188-
project = basename(projectfile_path(env_path)::String)
189-
idx = findfirst(x -> x == project, Base.project_names)
190-
@assert idx !== nothing
191-
return joinpath(env_path, Base.manifest_names[idx])
189+
n_names = length(man_names)
190+
if n_names == 1
191+
return joinpath(env_path, only(man_name))
192+
else
193+
project = basename(projectfile_path(env_path)::String)
194+
idx = findfirst(x -> x == project, Base.project_names)
195+
@assert idx !== nothing
196+
idx = idx + (n_names - length(Base.project_names)) # ignore custom name if present
197+
return joinpath(env_path, man_names[idx])
198+
end
192199
end
193200
end
194201

0 commit comments

Comments
 (0)