Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- This program aims to help developers by providing an easy way to download the Titanium Packager
- which should be used by all programs running via Titanium.
- The packager handles the downloading and loading of Titanium, as well as classes and
- files using a virtual file system.
- Usage: pastebin run 3hVHPYhH <path> [branch]
- The 'branch' parameter defines the target branch to download the packager from. This defaults to 'develop'
- ]]
- local args = { ... }
- if not args[ 1 ] then
- return error "A argument must be given that determines the path that the packager will be downloaded to"
- end
- if not http then
- return error "This program requires the HTTP API be loaded. Please load the HTTP API to continue (this maybe a problem with your CC configuration)"
- end
- local handle = http.get("https://gitlab.com/hbomb79/Titanium/raw/"..( args[ 2 ] or "develop" ).."/bin/package.lua")
- if not handle then
- return error "Failed to fetch packager, http GET failed. Ensure you have internet connection, otherwise try again later"
- end
- local content = handle.readAll()
- handle.close()
- local dest = fs.open( args[ 1 ], "w" )
- dest.write( content )
- dest.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement