From 42d8803aab1f7f9423ab6c4ed53c047c55c5fc29 Mon Sep 17 00:00:00 2001 From: Ale2610 Date: Wed, 9 Sep 2015 17:31:27 +0200 Subject: [PATCH] Update sPhone.lua --- src/sPhone.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/sPhone.lua b/src/sPhone.lua index 3012791..9e90b7a 100644 --- a/src/sPhone.lua +++ b/src/sPhone.lua @@ -41,6 +41,10 @@ local function kernel() devMode = false, } + if runningOnStartup then + fs.open("/startup","r") + end + if fs.exists("/.sPhone/config/username") then local u = fs.open("/.sPhone/config/username","r") sPhone.user = u.readLine() @@ -552,6 +556,8 @@ local function kernel() end +local runningOnStartup + term.setBackgroundColor(colors.black) term.clear() term.setCursorPos(1,1) @@ -567,9 +573,34 @@ if not pocket or not term.isColor() then return end +local tArgs = {...} + os.oldPullEvent = os.pullEvent os.pullEvent = os.pullEventRaw +local argData = { + ["-u"] = false, + ["-s"] = false, +} + +if #tArgs > 0 then + while #tArgs > 0 do + local tArgs = table.remove(tArgs, 1) + if argData[tArgs] ~= nil then + argData[tArgs] = true + end + end +end + +if argData["-u"] then + print("Getting installer...") + setfenv(loadstring(http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/installer.lua").readAll()),getfenv())() +end + +if argData["-s"] then + runningOnStartup = true +end + local ok, error = pcall(kernel) if not ok then