Skip to content

Commit

Permalink
ci(linux): only pack if latest version is not already packed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jul 28, 2024
1 parent b328444 commit 718dfe3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/pack_binary_rock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ local function get_latest_version(version_str_iterator)
return latest_sofar and latest_sofar > version and latest_sofar or version
end)
end
local latest_version = get_latest_version(output:gmatch("[%S+]%s+(%S+)%s+[^\n]+"))

local version_iter = vim.iter(output:gmatch("(%S+)%s+(%S+)%s+[^\n]+"))
:map(function(name, version)
if name == rock_name then
return version
end
end)
local latest_version = get_latest_version(version_iter)
if not latest_version then
error("Could not determine latest version of " .. rock_name)
end
Expand Down Expand Up @@ -59,6 +66,7 @@ Latest packed version: %s

if latest_packed_version and latest_packed_version >= latest_version then
print("Nothing to do.")
return
end

sc = vim.system({ "luarocks", "--local", "--lua-version=5.1", "install", rock_name, latest_version}):wait()
Expand Down

0 comments on commit 718dfe3

Please sign in to comment.