Spaces:
Runtime error
Runtime error
File size: 747 Bytes
1c6a4dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
using Pkg
function list_packages()
deps = Pkg.dependencies()
installs = Dict{String, Vector{Any}}()
for (uuid, dep) in deps
dep.is_direct_dep || continue
dep.version === nothing && continue
dep.source === nothing && continue
moddevdir = false
if haskey(ENV, "JULIA_PKG_DEVDIR")
moddevdir = true
end
if moddevdir && occursin(ENV["JULIA_PKG_DEVDIR"], dep.source)
installs[dep.name] = [dep.version, "dev"]
elseif !moddevdir && !isempty(findall(x -> x == "dev", splitpath(dep.source)))
installs[dep.name] = [dep.version, "dev"]
else
installs[dep.name] = [dep.version, ""]
end
end
return installs
end
const PACKAGES = [pkg for pkg in keys(list_packages())]
|