mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#145 removed unneeded references to config.lua files + some minification
This commit is contained in:
parent
a330249c7e
commit
76f21e925b
29
ccmsi.lua
29
ccmsi.lua
@ -18,7 +18,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
local function println(message) print(tostring(message)) end
|
||||
local function print(message) term.write(tostring(message)) end
|
||||
|
||||
local CCMSI_VERSION = "v1.12b"
|
||||
local CCMSI_VERSION = "v1.13"
|
||||
|
||||
local install_dir = "/.install-cache"
|
||||
local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/"
|
||||
@ -159,7 +159,7 @@ local function _clean_dir(dir, tree)
|
||||
if fs.isDir(path) then
|
||||
_clean_dir(path, tree[val])
|
||||
if #fs.list(path) == 0 then fs.delete(path);println("deleted "..path) end
|
||||
elseif (not _in_array(val, tree)) and (val ~= "config.lua" ) then ---@fixme remove condition after migration to settings files
|
||||
elseif (not _in_array(val, tree)) and (val ~= "config.lua" ) then
|
||||
fs.delete(path)
|
||||
println("deleted "..path)
|
||||
end
|
||||
@ -202,8 +202,8 @@ if #opts == 0 or opts[1] == "help" then
|
||||
yellow()
|
||||
println(" ccmsi check <branch> for target")
|
||||
lgray()
|
||||
println(" install - fresh install, overwrites config.lua")
|
||||
println(" update - update files EXCEPT for config.lua")
|
||||
println(" install - fresh install")
|
||||
println(" update - update files")
|
||||
println(" uninstall - delete files INCLUDING config/logs")
|
||||
white();println("<app>");lgray()
|
||||
println(" reactor-plc - reactor PLC firmware")
|
||||
@ -342,13 +342,8 @@ elseif mode == "install" or mode == "update" then
|
||||
ver.lockbox.v_remote = manifest.versions.lockbox
|
||||
|
||||
green()
|
||||
if mode == "install" then
|
||||
println("Installing " .. app .. " files...")
|
||||
elseif mode == "update" then
|
||||
if app == "pocket" then println("Updating " .. app .. " files... (keeping old config.lua)")
|
||||
else println("Updating " .. app .. " files...") end
|
||||
end
|
||||
white()
|
||||
if mode == "install" then println("Installing ") else println("Updating ") end
|
||||
println(app.." files...");white()
|
||||
|
||||
ver.boot.changed = show_pkg_change("bootldr", ver.boot)
|
||||
ver.common.changed = show_pkg_change("common", ver.common)
|
||||
@ -374,7 +369,6 @@ elseif mode == "install" or mode == "update" then
|
||||
local file_list = manifest.files
|
||||
local size_list = manifest.sizes
|
||||
local dependencies = manifest.depends[app]
|
||||
local config_file = app .. "/config.lua"
|
||||
|
||||
table.insert(dependencies, app)
|
||||
|
||||
@ -448,7 +442,6 @@ elseif mode == "install" or mode == "update" then
|
||||
|
||||
local files = file_list[dependency]
|
||||
for _, file in pairs(files) do
|
||||
if mode == "install" or file ~= config_file then
|
||||
local temp_file = install_dir.."/"..file
|
||||
if fs.exists(file) then fs.delete(file) end
|
||||
fs.move(temp_file, file)
|
||||
@ -456,7 +449,6 @@ elseif mode == "install" or mode == "update" then
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
fs.delete(install_dir)
|
||||
|
||||
@ -485,7 +477,6 @@ elseif mode == "install" or mode == "update" then
|
||||
|
||||
local files = file_list[dependency]
|
||||
for _, file in pairs(files) do
|
||||
if mode == "install" or file ~= config_file then
|
||||
println("GET "..file)
|
||||
local dl, err = http.get(repo_path..file)
|
||||
|
||||
@ -501,7 +492,6 @@ elseif mode == "install" or mode == "update" then
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if success then
|
||||
write_install_manifest(manifest, dependencies)
|
||||
@ -592,9 +582,12 @@ elseif mode == "uninstall" then
|
||||
end
|
||||
end
|
||||
|
||||
if fs.exists(legacy_config_file) then
|
||||
fs.delete(legacy_config_file);println("deleted "..legacy_config_file)
|
||||
end
|
||||
|
||||
if fs.exists(settings_file) then
|
||||
fs.delete(settings_file)
|
||||
println("deleted " .. settings_file)
|
||||
fs.delete(settings_file);println("deleted "..settings_file)
|
||||
end
|
||||
|
||||
fs.delete("install_manifest.json")
|
||||
|
Loading…
Reference in New Issue
Block a user