#117 installer v0.5 fixed colors and move not working

This commit is contained in:
Mikayla Fischler 2023-02-19 18:52:21 -05:00
parent df57e1859e
commit 726d15b48f

View File

@ -22,7 +22,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
local function println(message) print(tostring(message)) end local function println(message) print(tostring(message)) end
local function print(message) term.write(tostring(message)) end local function print(message) term.write(tostring(message)) end
local VERSION = "v0.4" local VERSION = "v0.5"
local install_dir = "/.install-cache" local install_dir = "/.install-cache"
local repo_path = "http://raw.githubusercontent.com/MikaylaFischler/cc-mek-scada/devel/" local repo_path = "http://raw.githubusercontent.com/MikaylaFischler/cc-mek-scada/devel/"
@ -172,7 +172,9 @@ if mode == "install" or mode == "update" then
term.setTextColor(colors.white) term.setTextColor(colors.white)
end end
else else
println("[" .. app .. "] fresh install of " .. remote_app_version) term.setTextColor(colors.blue)
println(remote_app_version)
term.setTextColor(colors.white)
end end
if local_comms_version ~= nil then if local_comms_version ~= nil then
@ -248,10 +250,12 @@ if mode == "install" or mode == "update" then
if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then
-- skip system package if unchanged, skip app package if not changed -- skip system package if unchanged, skip app package if not changed
-- skip packages that have no version if app version didn't change -- skip packages that have no version if app version didn't change
term.setTextColor(colors.white)
print("skipping download of unchanged package ") print("skipping download of unchanged package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)
else else
term.setTextColor(colors.white)
print("downloading package ") print("downloading package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)
@ -281,10 +285,12 @@ if mode == "install" or mode == "update" then
if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then
-- skip system package if unchanged, skip app package if not changed -- skip system package if unchanged, skip app package if not changed
-- skip packages that have no version if app version didn't change -- skip packages that have no version if app version didn't change
term.setTextColor(colors.white)
print("skipping install of unchanged package ") print("skipping install of unchanged package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)
else else
term.setTextColor(colors.white)
print("installing package ") print("installing package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)
@ -294,7 +300,7 @@ if mode == "install" or mode == "update" then
for _, file in pairs(files) do for _, file in pairs(files) do
if mode == "install" or file ~= config_file then if mode == "install" or file ~= config_file then
local temp_file = install_dir .. "/" .. file local temp_file = install_dir .. "/" .. file
if fs.exists(temp_file) then fs.delete(temp_file) end if fs.exists(file) then fs.delete(file) end
fs.move(temp_file, file) fs.move(temp_file, file)
end end
end end
@ -328,10 +334,12 @@ if mode == "install" or mode == "update" then
if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then if (dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version) then
-- skip system package if unchanged, skip app package if not changed -- skip system package if unchanged, skip app package if not changed
-- skip packages that have no version if app version didn't change -- skip packages that have no version if app version didn't change
term.setTextColor(colors.white)
print("skipping install of unchanged package ") print("skipping install of unchanged package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)
else else
term.setTextColor(colors.white)
print("installing package ") print("installing package ")
term.setTextColor(colors.blue) term.setTextColor(colors.blue)
println(dependency) println(dependency)