Browse Source

Freshnaut: Show URL where versions were checked

master
mid-kid 8 years ago
parent
commit
6073106b7d
  1. 26
      astronaut/freshnaut

26
astronaut/freshnaut

@ -137,7 +137,7 @@ function get_available_versions(satellite)
print("\x1B[1K\rWARNING: " .. satellite .. ": Current version isn't available") print("\x1B[1K\rWARNING: " .. satellite .. ": Current version isn't available")
end end
return versions return versions, update_url
end end
function check_new_versions(satellite, version_file_path) function check_new_versions(satellite, version_file_path)
@ -147,7 +147,7 @@ function check_new_versions(satellite, version_file_path)
-- Uses version_file_path to know where to store all known versions. -- Uses version_file_path to know where to store all known versions.
--]]-- --]]--
local versions = get_available_versions(satellite) local versions, update_url = get_available_versions(satellite)
if not versions then if not versions then
return return
end end
@ -166,15 +166,25 @@ function check_new_versions(satellite, version_file_path)
assert(version_file, "Failed to create " .. version_file_path) assert(version_file, "Failed to create " .. version_file_path)
end end
for version, _ in spairs(versions) do local new_versions = {}
if old_versions then if old_versions then
for version, _ in spairs(versions) do
if not old_versions[version] then if not old_versions[version] then
print("\x1B[1K\r" .. satellite .. ": " .. version) table.insert(new_versions, version)
version_file:write(version .. "\n")
end end
else end
print("\x1B[1K\r" .. satellite .. ": " .. version) else
for version, _ in spairs(versions) do
table.insert(new_versions, version)
end
end
if #new_versions > 0 then
print("\x1B[1K\r" .. satellite .. ": From '" .. update_url .. "'")
for _, version in ipairs(new_versions) do
version_file:write(version .. "\n") version_file:write(version .. "\n")
print("\x1B[1K\r" .. satellite .. ": " .. version)
end end
end end

Loading…
Cancel
Save