Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- local TURTI_ROOT_FOLDER = "/TURTI_OS_2.0"
- local TEMP_GIT_API_FILE = "/temp_turti_installation_file"
- if #args < 4 then
- error("please provide the following arguments: <gitApi(Pastebin)> <git-user> <repo> <library> (optional: <token>)")
- end
- local gitApiPastebinId = args[1]
- local gitUser = args[2]
- local gitRepo = args[3]
- local library = args[4]
- local token = args[5]
- local function install()
- shell.execute("pastebin", "get", gitApiPastebinId, TEMP_GIT_API_FILE)
- local gitApi = require(TEMP_GIT_API_FILE)
- if not fs.exists(TURTI_ROOT_FOLDER) then
- fs.makeDir(TURTI_ROOT_FOLDER)
- end
- gitApi.token = token
- gitApi.checkoutLibrary(gitUser, gitRepo, library, TURTI_ROOT_FOLDER)
- if fs.exists(TURTI_ROOT_FOLDER .. "/setup.lua") then
- shell.execute(TURTI_ROOT_FOLDER .. "/setup.lua")
- end
- end
- local status, err = xpcall(install, debug.traceback)
- if not status then
- print("Installation failed (see turti_err.log)")
- local errFile = fs.open("turti_err.log", "w")
- errFile.write(err)
- errFile.close()
- else
- print("Installation successful")
- end
- if fs.exists(TEMP_GIT_API_FILE) then
- fs.delete(TEMP_GIT_API_FILE)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement