Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lk = http.get("https://raw.githubusercontent.com/swiftOS/swiftOS-Packages/master/Packages/libkpm.lua")
- if lk and lk.readAll then
- local libkpm = loadstring( lk.readAll() )()
- local function makeBlank(loc)
- local file = fs.open(loc, "w")
- file.write("{}")
- file.close()
- end
- local function gpr(text)
- if term.isColor() then
- term.setTextColor(colors.green)
- end
- print(text)
- term.setTextColor(colors.white)
- end
- gpr("Creating /usr/etc/kpm")
- fs.makeDir("/usr/etc/kpm")
- gpr("Creating packages.kpm")
- makeBlank("/usr/etc/kpm/packages.kpm")
- gpr("Creating installed.kpm")
- makeBlank("/usr/etc/kpm/installed.kpm")
- gpr("Creating sources.kpm")
- makeBlank("/usr/etc/kpm/sources.kpm")
- gpr("Creating base files done, adding main repository")
- libkpm.addRepo( "https://raw.githubusercontent.com/swiftOS/swiftOS-Packages/master/repo.kpm" )
- gpr("Syncing repository...")
- libkpm.sync()
- gpr("Downloading 'base' metapackage - this will install swiftOS, would you like to continue? (y/n)")
- local m = string.lower( read() )
- if m == "yes" or m == "y" then
- libkpm.install("base")
- gpr("Done. Reboot!")
- else
- error("Canceled install.", 0)
- end
- else
- error("Couldn't connect to get libkpm.", 0)
- end
Advertisement
Add Comment
Please, Sign In to add comment