Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not http then
- print("Enable http to install")
- return
- end
- local Success = true
- local Dirs = {
- "Resources";
- "APIs";
- "Settings";
- "Programs";
- "Home";
- }
- local function Download(Link)
- local Res = http.get(Link)
- if not Link then
- print("Unable to download files")
- return nil
- end
- return Res
- end
- local Downloads = {
- {"https://github.com/alakazard12/NovaOS/raw/master/Boot", "Boot"};
- {"https://github.com/alakazard12/NovaOS/raw/master/Resources/Logo", "Resources/Logo"};
- {"https://github.com/alakazard12/APIs/raw/master/Gapi", "APIs/Gapi"};
- }
- if fs.exists("/NovaOS") then
- fs.delete("/NovaOS")
- end
- for i,v in pairs(Dirs) do
- fs.makeDir("/NovaOS/" .. v)
- end
- for i,v in pairs(Downloads) do
- print("Downloading [" .. i .. "/" .. #Downloads .. "]")
- local Get = Download(v[1])
- if not Get then
- Success = false
- return
- end
- local Flo = fs.open("/NovaOS/" .. v[2], "w")
- Flo.write(Get.readAll())
- Flo.close()
- end
- if Success == true then
- print("NovaOS has been installed, reboot to start NovaOS")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement