diff --git a/README.md b/README.md index 7898c05..412d948 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A universal, customizable and feature-packed operating system for OpenComputers. ## Installation To install Halyde from OpenOS, simply run: -`pastebin run xBtk6bFi` +`pastebin run cwir7NH5` If for some reason that doesn't work, try: diff --git a/halyde/core/boot.lua b/halyde/core/boot.lua index a3d9da4..1e87def 100644 --- a/halyde/core/boot.lua +++ b/halyde/core/boot.lua @@ -1,7 +1,7 @@ local loadfile = ... local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile) -_G._OSVERSION = "Halyde 1.0.2" +_G._OSVERSION = "Halyde 1.0.1" function _G.import(module, ...) local args = table.pack(...) diff --git a/webinstall.lua b/webinstall.lua index fadf008..0386c37 100644 --- a/webinstall.lua +++ b/webinstall.lua @@ -54,12 +54,7 @@ end -- installation local computer = require("computer") -local oldFiles = {} -for oldFile in fs.list(installLocation) do - if oldFile ~= "home/" then - table.insert(oldFiles, oldFile) - end -end + local function getFile(url) local request, data, tmpdata = nil, "", nil local status, errorMessage = pcall(function() @@ -112,14 +107,31 @@ local function getFile(path) return data end end -print("a") local webInstallConfig = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum.cfg") -print("a") webInstallConfig = load(webInstallConfig) -print("a") webInstallConfig = webInstallConfig() -print("a") -installationOrder = {"halyde", "edit", "argentum"} +local installationOrder = {"halyde", "edit", "argentum"} +local oldFiles = {} +for oldFile in fs.list(installLocation) do + local usedFlag = false + for i = 1, 3 do + for _, file in pairs(webInstallConfig[installationOrger[i]].files) do + if oldFile == file then + usedFlag = true + end + end + if webInstallConfig[installationOrger[i]].directories then + for _, dir in pairs(webInstallConfig[installationOrger[i]].directories) do + if oldFile == dir .. "/" then + usedFlag = true + end + end + end + end + if not usedFlag then + table.insert(oldFiles, oldFile) + end +end for i = 1, 3 do local webInstallConfig = webInstallConfig[installationOrder[i]] print("a") @@ -136,5 +148,8 @@ for i = 1, 3 do handle:close() end end +for _, oldFile in pairs(oldFiles) do + fs.remove(oldFile) +end computer.setBootAddress(component.get(installLocation:sub(6, -2))) computer.shutdown(true)