mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
cleanup
This commit is contained in:
parent
c93cd4d0bd
commit
375e969161
@ -87,6 +87,7 @@ local function write_files(files, path)
|
||||
end
|
||||
end
|
||||
|
||||
-- write installation manifiest and offline install manager
|
||||
local function write_install()
|
||||
local handle = fs.open("install_manifest.json", "w")
|
||||
handle.write(b64_decode(install_manifest))
|
||||
@ -103,7 +104,7 @@ lgray()
|
||||
write_files(app_files, "/")
|
||||
write_files(dep_files, "/")
|
||||
|
||||
-- write a install manifest and offline installer
|
||||
-- write an install manifest and the offline installer
|
||||
write_install()
|
||||
|
||||
green()
|
||||
|
@ -7,7 +7,7 @@ import sys
|
||||
path_prefix = "./_minified/"
|
||||
|
||||
# get git build info
|
||||
build = subprocess.check_output(["git", "describe", "--tags"]).strip().decode("utf-8")
|
||||
build = subprocess.check_output(["git", "describe", "--tags"]).strip().decode('UTF-8')
|
||||
|
||||
# list files in a directory
|
||||
def list_files(path):
|
||||
@ -110,7 +110,7 @@ manifest = {
|
||||
"coordinator" : list_files("./coordinator"),
|
||||
"pocket" : list_files("./pocket"),
|
||||
},
|
||||
"depends" : [ "system", "scada-common", "graphics", "lockbox" ],
|
||||
"depends" : [ "system", "scada-common", "graphics", "lockbox" ]
|
||||
}
|
||||
|
||||
# write the application installation items as Lua tables
|
||||
|
@ -132,7 +132,7 @@ if #opts == 0 or opts[1] == "help" then
|
||||
println(" check - check your installed versions")
|
||||
println(" update-rm - delete everything except the config,")
|
||||
println(" so that you can upload files for a")
|
||||
println(" new two-file/off-line update")
|
||||
println(" new two-file off-line update")
|
||||
println(" uninstall - delete all app files and config")
|
||||
return
|
||||
else
|
||||
@ -144,7 +144,6 @@ else
|
||||
end
|
||||
|
||||
-- run selected mode
|
||||
|
||||
if mode == "check" then
|
||||
local local_ok, manifest = read_local_manifest()
|
||||
if not local_ok then
|
||||
|
@ -44,11 +44,9 @@ def get_version(path, is_lib = False):
|
||||
|
||||
# generate installation manifest object
|
||||
def make_manifest(size):
|
||||
os.chdir('./_minified')
|
||||
|
||||
manifest = {
|
||||
"versions" : {
|
||||
"installer" : get_version("../ccmsi.lua"),
|
||||
"installer" : get_version("./ccmsi.lua"),
|
||||
"bootloader" : get_version("./startup.lua"),
|
||||
"common" : get_version("./scada-common/util.lua", True),
|
||||
"comms" : get_version("./scada-common/comms.lua", True),
|
||||
@ -97,8 +95,6 @@ def make_manifest(size):
|
||||
}
|
||||
}
|
||||
|
||||
os.chdir('../')
|
||||
|
||||
return manifest
|
||||
|
||||
# write initial manifest with placeholder size
|
||||
|
@ -160,7 +160,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 ---@todo delete on full release
|
||||
elseif (not _in_array(val, tree)) and (val ~= "config.lua" ) then ---@todo remove config.lua on full release
|
||||
fs.delete(path)
|
||||
println("deleted "..path)
|
||||
end
|
||||
@ -249,7 +249,6 @@ else
|
||||
end
|
||||
|
||||
-- run selected mode
|
||||
|
||||
if mode == "check" then
|
||||
local ok, manifest = get_remote_manifest()
|
||||
if not ok then return end
|
||||
|
Loading…
Reference in New Issue
Block a user