polish up installer
This commit is contained in:
parent
c7d7f9be98
commit
6cf175e5f0
@ -64,6 +64,7 @@ local function main()
|
||||
end
|
||||
end
|
||||
|
||||
if #toDownload > 0 then
|
||||
log.info(#toDownload .. " files to download")
|
||||
for k, v in ipairs(toDownload) do
|
||||
if not fs.exists("/tmp") then
|
||||
@ -82,15 +83,19 @@ local function main()
|
||||
tempfile.close()
|
||||
if filehash ~= v.hash then
|
||||
log.error("File " .. v.dest .. " (from " .. v.src .. ") has a mismatched hash.")
|
||||
log.error("Installation aborted.")
|
||||
log.error("Installation aborted. Remember to clean /tmp manually.")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
log.info("Installing")
|
||||
for k, v in ipairs(toDownload) do
|
||||
fs.delete(v.dest)
|
||||
fs.move("/tmp/" .. v.hash .. ".lua", v.dest)
|
||||
end
|
||||
else
|
||||
log.info("Nothing to do")
|
||||
end
|
||||
|
||||
log.info("Installation complete!")
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user