Fixed updater

Contrast_Picker
Arcidayne 9 years ago
parent 7196e19d37
commit 966b397c1c

@ -229,12 +229,12 @@ function update_plugin ()
async_ok, async = pcall (require, "async") async_ok, async = pcall (require, "async")
if async_ok then if async_ok then
plugin_page = async.doAsyncRemoteRequest(raw, function(retval, page, status, headers, full_status, request_url) if status == 200 then raw_version = tonumber(page:match('%s%s+version="([0-9%.]+)"') end end, "HTTPS") plugin_page = async.doAsyncRemoteRequest(raw, function(retval, page, status, headers, full_status, request_url) if status == 200 then raw_version = page:match('%s%s+version="([0-9%.]+)"') end end, "HTTPS")
end end
if raw_version == pversion then if tonumber(raw_version) == pversion then
ColourNote("white", "blue", GetPluginInfo(pid, 1) .. " is up-to-date.") ColourNote("white", "blue", GetPluginInfo(pid, 1) .. " is up-to-date.")
elseif raw_version > pversion then elseif to_number(raw_version) > pversion then
ColourNote("white", "blue", "Updating from version " .. pversion .. " to " .. raw_version .. ". Do not touch anything.") ColourNote("white", "blue", "Updating from version " .. pversion .. " to " .. raw_version .. ". Do not touch anything.")
local file = io.open(pfile, "w") local file = io.open(pfile, "w")
file:write(page) file:write(page)

Loading…
Cancel
Save