Skip to content

Commit

Permalink
fix: attempt to concatenate field version (a nil value) when instal…
Browse files Browse the repository at this point in the history
…ling
  • Loading branch information
mrcjkb committed Nov 1, 2024
1 parent 7c53c41 commit e8e3650
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lua/rocks/adapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ end
---@param rock RockSpec | Rock
---@return boolean created
function adapter.init_site_symlink_sync(rock)
if not rock.version then
log.info("Cannot init site symlink without rock version")
return false
end
local rock_dir = get_rock_dir(rock)
local handle = vim.uv.fs_scandir(rock_dir)
while handle do
Expand Down
6 changes: 5 additions & 1 deletion lua/rocks/runtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ function runtime.packadd(rock_spec, opts)
opts = vim.tbl_deep_extend("force", {
bang = false,
}, opts or {})
if not adapter.has_site_symlink(rock_spec) and not adapter.init_site_symlink_sync(rock_spec) then
if
rock_spec.version
and not adapter.has_site_symlink(rock_spec)
and not adapter.init_site_symlink_sync(rock_spec)
then
log.warn(("Rock %s does not appear to be installed."):format(rock_spec.name))
return false
end
Expand Down

0 comments on commit e8e3650

Please sign in to comment.