Skip to content

Commit

Permalink
fix(install): bug causing : to be appended to version in rocks.toml (
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Dec 11, 2023
1 parent 22a9b63 commit 8e8ceec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/rocks/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ constants.DEFAULT_CONFIG = string.format(
# List of Neovim plugins to install alongside their versions.
# If the plugin name contains a dot then you must add quotes to the key name!
[plugins]
"rocks.nvim" = "%s-1" # rocks.nvim can also manage itself :D
"rocks.nvim" = "%s" # rocks.nvim can also manage itself :D
]],
constants.ROCKS_VERSION
)
Expand Down
3 changes: 2 additions & 1 deletion lua/rocks/operations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ operations.install = function(name, version, progress_handle)
name = name,
-- The `gsub` makes sure to escape all punctuation characters
-- so they do not get misinterpreted by the lua pattern engine.
version = sc.stdout:match(name:gsub("%p", "%%%1") .. "%s+(%S+)"),
-- We also exclude `-<specrev>` from the version match.
version = sc.stdout:match(name:gsub("%p", "%%%1") .. "%s+([^-%s]+)"),
}
if progress_handle then
progress_handle:report({
Expand Down
3 changes: 2 additions & 1 deletion lua/rocks/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ state.installed_rocks = nio.create(function()
local installed_rock_list = future.wait()

for name, version in installed_rock_list:gmatch("(%S+)%s+(%S+)%s+installed%s+%S+") do
rocks[name] = { name = name, version = version }
-- Exclude -<specrev>
rocks[name] = { name = name, version = version:match("([^-]+)") }
end

return rocks
Expand Down

0 comments on commit 8e8ceec

Please sign in to comment.