pass current program to finishInstall
This commit is contained in:
parent
a7f0295fed
commit
721db1cd90
2 changed files with 14 additions and 3 deletions
|
@ -85,6 +85,10 @@ local function getAllFiles(program)
|
|||
end
|
||||
|
||||
local function finishInstall(program, files)
|
||||
if files == nil then
|
||||
print("files var is nil")
|
||||
error()
|
||||
end
|
||||
for key, file in ipairs(files) do
|
||||
if customPath ~= nil then
|
||||
print("moving " .. file .. " to " .. customPath .. "...")
|
||||
|
|
|
@ -104,7 +104,11 @@ local function getAllFiles(program)
|
|||
end
|
||||
|
||||
local function finishInstall(program, files)
|
||||
for key, file in ipairs(files) do
|
||||
if files == nil then
|
||||
print("files var is nil")
|
||||
error()
|
||||
end
|
||||
for _, file in ipairs(files) do
|
||||
if customPath ~= nil then
|
||||
print("moving " .. file .. " to " .. customPath .. "...")
|
||||
if not fs.exists(customPath) then
|
||||
|
@ -145,13 +149,16 @@ if programToInstall == nil then
|
|||
if value ~= "" and value ~= nil then
|
||||
print("checking for updates for " .. value)
|
||||
local files = getAllFiles(value)
|
||||
if files ~= nil then
|
||||
|
||||
if #files == 0 then
|
||||
print("no updates found.")
|
||||
elseif files ~= nil then
|
||||
for _, value2 in ipairs(files) do
|
||||
if value2 ~= nil then
|
||||
downloadFile(value, value2)
|
||||
end
|
||||
end
|
||||
finishInstall(files)
|
||||
finishInstall(value, files)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue