Skip to content

Commit

Permalink
look through other dirs in LOAD_PATH to resolve /pkg/ URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashi Gowda committed Jun 13, 2018
1 parent 0ab1f0c commit 6aec344
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/examples/files.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,18 @@ dirresponse(f) =

const ASSETS_DIR = "assets"
function packagefiles(dirs=true)
absdir(req) = Pkg.dir(req[:params][:pkg], ASSETS_DIR)
loadpaths = unique(vcat(Pkg.dir(), LOAD_PATH))
function absdir(req)
pkg = req[:params][:pkg]
for p in loadpaths
dir = joinpath(p, pkg, ASSETS_DIR)
if isdir(dir)
return dir
end
end
Pkg.dir(pkg, ASSETS_DIR)
end

branch(req -> validpath(absdir(req), joinpath(req[:path]...), dirs=dirs),
req -> (Base.warn_once("""
Relying on /pkg/ is now deprecated. Please use the package
Expand Down

0 comments on commit 6aec344

Please sign in to comment.