Skip to content

Commit d487ba2

Browse files
Add Base.active_manifest()
1 parent a046da5 commit d487ba2

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ New library functions
2525
New library features
2626
--------------------
2727

28-
`sort(keys(::Dict))` and `sort(values(::Dict))` now automatically collect, they previously threw ([#56978]).
28+
* `sort(keys(::Dict))` and `sort(values(::Dict))` now automatically collect, they previously threw ([#56978]).
29+
* New `Base.active_manifest()` function to return the path of the active manifest, like `Base.active_project()` ([#])
2930

3031
Standard library changes
3132
------------------------

base/initdefs.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,21 @@ function set_active_project(projfile::Union{AbstractString,Nothing})
379379
end
380380
end
381381

382+
"""
383+
active_manifest()
384+
385+
Return the path of the active manifest file. See [`Project environments`](@ref) for
386+
details on the difference between a project and a manifest, and the naming options and
387+
their priority when searching for a manifest file.
388+
389+
See also [`Base.active_project`](@ref), [`Base.set_active_project`](@ref).
390+
"""
391+
function active_manifest(search_load_path::Bool=true)
392+
proj = active_project(search_load_path)
393+
proj === nothing && return nothing
394+
return project_file_manifest_path(proj)
395+
end
396+
382397

383398
"""
384399
load_path()

base/loading.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ function project_file_manifest_path(project_file::String)::Union{Nothing,String}
827827
manifest_path === missing || return manifest_path
828828
end
829829
dir = abspath(dirname(project_file))
830+
isfile_casesensitive(project_file) || return nothing
830831
d = parsed_toml(project_file)
831832
base_manifest = workspace_manifest(project_file)
832833
if base_manifest !== nothing

base/public.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public
5050
DL_LOAD_PATH,
5151
load_path,
5252
active_project,
53+
active_manifest,
5354

5455
# Reflection and introspection
5556
isambiguous,

doc/src/base/base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ ans
4444
err
4545
Base.active_project
4646
Base.set_active_project
47+
Base.active_manifest
4748
```
4849

4950
## [Keywords](@id Keywords)

0 commit comments

Comments
 (0)