Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 11, 2024
1 parent c5589cc commit 0d3f44d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion frontend/components/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ const PkgPopup = ({ notebook, recent_event, clear_recent_event, disable_input })
} else if (recent_event?.type === "nbpkg") {
;(pluto_actions.get_avaible_versions({ package_name: recent_event.package_name, notebook_id: notebook.notebook_id }) ?? Promise.resolve([])).then(
({ versions, url }) => {
console.log({ url })
if (still_valid) {
set_pkg_status(
package_status({
Expand Down
12 changes: 7 additions & 5 deletions src/packages/PkgCompat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,23 +361,25 @@ function package_versions(package_name::AbstractString)::Vector
end
end

# ✅ "Public" API using RegistryInstances
"""
Return the URL of the package's documentation (if possible) or homepage. Returns `nothing` if the package was not found.
"""
function package_url(package_name::AbstractString)::Union{String,Nothing}
if is_stdlib(package_name)
"https://docs.julialang.org/en/v1/stdlib/$(package_name)/"
else
try
for reg in _parsed_registries[]
uuids_with_name = RegistryInstances.uuids_from_name(reg, package_name)
for u in uuids_with_name
for u in RegistryInstances.uuids_from_name(reg, package_name)
pkg = get(reg, u, nothing)
if pkg !== nothing
info = RegistryInstances.registry_info(pkg)
return info.repo
return RegistryInstances.registry_info(pkg).repo
end
end
end
catch e
@warn "Pkg compat: failed to get installable versions." exception=(e,catch_backtrace())
@warn "Pkg compat: failed to get package URL." exception=(e,catch_backtrace())
end
end
end
Expand Down

0 comments on commit 0d3f44d

Please sign in to comment.