Skip to content

Commit

Permalink
fix: compare versions when getting latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Dec 9, 2024
1 parent 1f2943d commit da06852
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/rocks-git/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ function parser.parse_git_latest_semver_tag(stdout)
local latest_version = nil
for tag in stdout:gmatch("refs/tags/([^\n]+)") do
local version = parser.get_version(tag)
if version then
if version and latest_version and version > latest_version then
latest_tag = tag
latest_version = version
elseif version and not latest_version then
latest_tag = tag
latest_version = version
end
Expand Down

0 comments on commit da06852

Please sign in to comment.