Update setup.lua

This commit is contained in:
CadenCoaster
2025-08-06 11:29:12 -07:00
committed by GitHub
parent bee55ea2ac
commit 0a39ae2368

View File

@@ -1,4 +1,4 @@
local function installMBS(loc,...) local function installMBS(...)
local arg = {...} local arg = {...}
local root_dir = settings.get("mbs.install_path", ".mbs") local root_dir = settings.get("mbs.install_path", ".mbs")
local rom_dir = "rom/.mbs" local rom_dir = "rom/.mbs"
@@ -170,7 +170,7 @@ local function installMBS(loc,...)
end end
-- We'll run at the first possible position to ensure -- We'll run at the first possible position to ensure
local handle = fs.open(loc, "w") local handle = fs.open("startup/00_mbs.lua", "w")
local current = shell.getRunningProgram() local current = shell.getRunningProgram()
handle.writeLine(("assert(loadfile(%q, _ENV))('startup', %q)"):format(current, current)) handle.writeLine(("assert(loadfile(%q, _ENV))('startup', %q)"):format(current, current))
handle.close() handle.close()
@@ -316,7 +316,7 @@ if netmount then
local file = fs.open("/startup/-01_mount.lua","w") local file = fs.open("/startup/-01_mount.lua","w")
local filedata = http.get(url.."/mount.lua").readAll() local filedata = http.get(url.."/mount.lua").readAll()
if mbs then if mbs then
filedata:gsub('shell%.run%("shell"%)','shell.run(".mbs.lua")') filedata:gsub('shell%.run%("shell"%)','shell.run("/startup/00_mbs.lua")')
end end
file.write(filedata) file.write(filedata)
file.close() file.close()
@@ -325,9 +325,9 @@ if netmount then
end end
if mbs and not netmount then if mbs and not netmount then
installMBS("startup/00_mbs.lua","install") installMBS("install")
elseif mbs and netmount then elseif mbs and netmount then
installMBS(".mbs.lua","install") installMBS("install")
end end
os.reboot() os.reboot()