Skip to content

Instantly share code, notes, and snippets.

@icedream
Last active December 16, 2015 04:29
Show Gist options
  • Select an option

  • Save icedream/5377821 to your computer and use it in GitHub Desktop.

Select an option

Save icedream/5377821 to your computer and use it in GitHub Desktop.
Example Lua script to describe how to install/uninstall mods.
-- Example instructions file for a mod in the
-- Craftitude Repository system
-- As applicable to draft 0.7 (upcoming)
function Install()
-- Download a file
var download = GetResolver("download", { url="http://this.is.a.websi.te/with/an/archive/on/it.zip" })
-- Convert the download to a usable archive
var archive = GetResolver("archive", { input = download })
-- Install JAR into "mods" folder
-- Inject repacks all the files
archive:InjectTo("mods/thisisamod.jar")
end
function Uninstall()
-- Delete JAR from "mods" folder
DeleteFile("mods/thisisamod.jar")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment