diff --git a/lua/rocks/constants.lua b/lua/rocks/constants.lua index 4a1be5de..19e0dd26 100644 --- a/lua/rocks/constants.lua +++ b/lua/rocks/constants.lua @@ -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 ) diff --git a/lua/rocks/operations.lua b/lua/rocks/operations.lua index 51ba5de3..52919783 100644 --- a/lua/rocks/operations.lua +++ b/lua/rocks/operations.lua @@ -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 `-` from the version match. + version = sc.stdout:match(name:gsub("%p", "%%%1") .. "%s+([^-%s]+)"), } if progress_handle then progress_handle:report({ diff --git a/lua/rocks/state.lua b/lua/rocks/state.lua index 64eba1e9..d29f12fe 100644 --- a/lua/rocks/state.lua +++ b/lua/rocks/state.lua @@ -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 - + rocks[name] = { name = name, version = version:match("([^-]+)") } end return rocks