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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- write installation manifiest and offline install manager
|
||||||
local function write_install()
|
local function write_install()
|
||||||
local handle = fs.open("install_manifest.json", "w")
|
local handle = fs.open("install_manifest.json", "w")
|
||||||
handle.write(b64_decode(install_manifest))
|
handle.write(b64_decode(install_manifest))
|
||||||
@ -103,7 +104,7 @@ lgray()
|
|||||||
write_files(app_files, "/")
|
write_files(app_files, "/")
|
||||||
write_files(dep_files, "/")
|
write_files(dep_files, "/")
|
||||||
|
|
||||||
-- write a install manifest and offline installer
|
-- write an install manifest and the offline installer
|
||||||
write_install()
|
write_install()
|
||||||
|
|
||||||
green()
|
green()
|
||||||
|
@ -7,7 +7,7 @@ import sys
|
|||||||
path_prefix = "./_minified/"
|
path_prefix = "./_minified/"
|
||||||
|
|
||||||
# get git build info
|
# 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
|
# list files in a directory
|
||||||
def list_files(path):
|
def list_files(path):
|
||||||
@ -110,7 +110,7 @@ manifest = {
|
|||||||
"coordinator" : list_files("./coordinator"),
|
"coordinator" : list_files("./coordinator"),
|
||||||
"pocket" : list_files("./pocket"),
|
"pocket" : list_files("./pocket"),
|
||||||
},
|
},
|
||||||
"depends" : [ "system", "scada-common", "graphics", "lockbox" ],
|
"depends" : [ "system", "scada-common", "graphics", "lockbox" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
# write the application installation items as Lua tables
|
# 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(" check - check your installed versions")
|
||||||
println(" update-rm - delete everything except the config,")
|
println(" update-rm - delete everything except the config,")
|
||||||
println(" so that you can upload files for a")
|
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")
|
println(" uninstall - delete all app files and config")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
@ -144,7 +144,6 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- run selected mode
|
-- run selected mode
|
||||||
|
|
||||||
if mode == "check" then
|
if mode == "check" then
|
||||||
local local_ok, manifest = read_local_manifest()
|
local local_ok, manifest = read_local_manifest()
|
||||||
if not local_ok then
|
if not local_ok then
|
||||||
|
@ -44,11 +44,9 @@ def get_version(path, is_lib = False):
|
|||||||
|
|
||||||
# generate installation manifest object
|
# generate installation manifest object
|
||||||
def make_manifest(size):
|
def make_manifest(size):
|
||||||
os.chdir('./_minified')
|
|
||||||
|
|
||||||
manifest = {
|
manifest = {
|
||||||
"versions" : {
|
"versions" : {
|
||||||
"installer" : get_version("../ccmsi.lua"),
|
"installer" : get_version("./ccmsi.lua"),
|
||||||
"bootloader" : get_version("./startup.lua"),
|
"bootloader" : get_version("./startup.lua"),
|
||||||
"common" : get_version("./scada-common/util.lua", True),
|
"common" : get_version("./scada-common/util.lua", True),
|
||||||
"comms" : get_version("./scada-common/comms.lua", True),
|
"comms" : get_version("./scada-common/comms.lua", True),
|
||||||
@ -97,8 +95,6 @@ def make_manifest(size):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
os.chdir('../')
|
|
||||||
|
|
||||||
return manifest
|
return manifest
|
||||||
|
|
||||||
# write initial manifest with placeholder size
|
# write initial manifest with placeholder size
|
||||||
|
@ -160,7 +160,7 @@ local function _clean_dir(dir, tree)
|
|||||||
if fs.isDir(path) then
|
if fs.isDir(path) then
|
||||||
_clean_dir(path, tree[val])
|
_clean_dir(path, tree[val])
|
||||||
if #fs.list(path) == 0 then fs.delete(path);println("deleted "..path) end
|
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)
|
fs.delete(path)
|
||||||
println("deleted "..path)
|
println("deleted "..path)
|
||||||
end
|
end
|
||||||
@ -249,7 +249,6 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- run selected mode
|
-- run selected mode
|
||||||
|
|
||||||
if mode == "check" then
|
if mode == "check" then
|
||||||
local ok, manifest = get_remote_manifest()
|
local ok, manifest = get_remote_manifest()
|
||||||
if not ok then return end
|
if not ok then return end
|
||||||
|
Loading…
Reference in New Issue
Block a user