This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kolpa's profile picture

Github Update Checker

Started by Kolpa, 03 January 2013 - 02:03 AM
Kolpa #1
Posted 03 January 2013 - 03:03 AM
this API is the first out of a set to make the user experience on github hosted apps better

a Downloader will follow and probably also a crash reporter

but lets get to the interesting part

Note that this API will not download any code for you

it will only check if the user is using the latest commit

using this API is very simple and looking at this example should probably tell you everything you need to know:


local updater = dofile("lib/updater.lua")

local function update()
print("done")
end
updater.new() -- this will check for any updates for the updater
updater.update(update, "Kolpa", "lol-pro-spectator") -- first argument is the function to be executed in case of an update second is the username and last is the repostery where the program is located


the json parsing in this API is done by David Kolf's JSON module which i highly recommend using for tasks like this

Download


Changelog
Kolpa #2
Posted 04 January 2013 - 03:39 AM
bump added command to check and install updater updates also fixed a error with repos over 100 commits
Eric #3
Posted 10 January 2013 - 09:21 AM
You inspired me to make this, which does download all the code - it might be worth adding the update detection.