Grin is a tool designed to make github based distribution simple. With grin, you can package a release together in a zip file and distribute that to CC users.
Github
Pastebin VuBNx3va
How it works
Unfortunately, there's a bug in LuaJ that prevents CC from getting binary data properly, so normal zips won't quite work. But we do want to use zip files! So to get around this, releases have to be zipped, then encoded with base64. On unix/linux/mac, use the base64 command line utility. On windows, use the certutil command line utility. Once you have your desired release packaged up, create a release on github, and attach the .zip.base64 file to the release.
That's it
That's all you need to do. Now any user can use grin -u YourUsername -r YourRepo dir to download, decode, and unarchive your release to the desired directory.
Tags
Grin takes an optional argument "-t tag_name" that specifies the tag of a release to download, if you don't want to download just the latest release.
Custom Installers
Of course, you can (and probably should) create your own installer that calls grin from pastebin with specified arguments. For example
shell.run("pastebin", "run", "VuBNx3va", "-u", "YourUsername", "-r", "YourRepo", "desiredDir")
print("Installed")
That's all it takes. Put your equivalent of that code on a pastebin and all your users have to do to install your project is pastebin run ID.
But there's now a new flag that lets your custom installers look how you like. The -emit-events (or -e) flag can be used to tell grin to emit events with progress messages instead of printing them. This allows you to do a custom view over Grin.
local ok, err
parallel.waitForAny(function()
ok, err = pcall(shell.run, "grin", "-e", "-u", user, "-r", repo, dir)
end, function()
while true do
local e, s = os.pullEvent("grin_install_status")
local x, y = term.getCursorPos()
term.setCursorPos(1, y)
term.clearLine()
term.write(s)
end
end)
assert(ok, err)
local x, y = term.getCursorPos()
term.setCursorPos(1, y)
term.clearLine()
print(user, "/", repo, " successfully downloaded")
A Note About Transparency
Grin's main feature is transparency. It's easy to install Grin packages, and users don't even have to know they're using Grin. It's really easy to make an installer that invokes Grin to install your package, and that installer can just be put on pastebin. Letting users do pastebin run CODE to get your program installed is a big plus. And when you have a big project, that's not always trivial to do. And all this comes with the added benefits of handling versioning seamlessly, and enabling binary downloads. I hope Grin will help us solve installations problem.