Skip to content

Commit 361a5bd

Browse files
committed
When using a custom depot, still look in bundled directories.
1 parent 13d3efb commit 361a5bd

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

base/initdefs.jl

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ See also [`JULIA_DEPOT_PATH`](@ref JULIA_DEPOT_PATH), and
8686
"""
8787
const DEPOT_PATH = String[]
8888

89-
function append_default_depot_path!(DEPOT_PATH)
90-
path = joinpath(homedir(), ".julia")
91-
path in DEPOT_PATH || push!(DEPOT_PATH, path)
89+
function append_bundled_depot_path!(DEPOT_PATH)
9290
path = abspath(Sys.BINDIR, "..", "local", "share", "julia")
9391
path in DEPOT_PATH || push!(DEPOT_PATH, path)
9492
path = abspath(Sys.BINDIR, "..", "share", "julia")
@@ -98,21 +96,26 @@ end
9896

9997
function init_depot_path()
10098
empty!(DEPOT_PATH)
99+
populated = false
100+
101101
if haskey(ENV, "JULIA_DEPOT_PATH")
102102
str = ENV["JULIA_DEPOT_PATH"]
103-
isempty(str) && return
104103
for path in eachsplit(str, Sys.iswindows() ? ';' : ':')
105-
if isempty(path)
106-
append_default_depot_path!(DEPOT_PATH)
107-
else
108-
path = expanduser(path)
109-
path in DEPOT_PATH || push!(DEPOT_PATH, path)
110-
end
104+
isempty(path) && continue
105+
path = expanduser(path)
106+
path in DEPOT_PATH || push!(DEPOT_PATH, path)
107+
populated = true
111108
end
112-
else
113-
append_default_depot_path!(DEPOT_PATH)
114109
end
115-
nothing
110+
111+
if !populated
112+
path = joinpath(homedir(), ".julia")
113+
push!(DEPOT_PATH, path)
114+
end
115+
116+
append_bundled_depot_path!(DEPOT_PATH)
117+
118+
return
116119
end
117120

118121
## LOAD_PATH & ACTIVE_PROJECT ##

0 commit comments

Comments
 (0)