fix path issue, remove debugs

This commit is contained in:
jane 2021-06-06 01:08:13 -04:00
parent 803a5ba06f
commit 53a3145ce0

View file

@ -58,16 +58,16 @@ local function getAllFiles(program)
local updateUrl = url .. "/updates/" .. program local updateUrl = url .. "/updates/" .. program
local currentFiles = "" local currentFiles = ""
if fs.exists(path .. "indexes.dat") then if fs.exists(path .. program .. "indexes.dat") then
print("#DEBUG path " .. path .. program .. "/indexes.dat") --print("#DEBUG path " .. path .. program .. "/indexes.dat")
local indexesFile = fs.open(path .. program .. "/indexes.dat", "r") local indexesFile = fs.open(path .. program .. "/indexes.dat", "r")
local indexesFileText = indexesFile.readAll() local indexesFileText = indexesFile.readAll()
print("#DEBUG indexesFileText " .. indexesFileText) --print("#DEBUG indexesFileText " .. indexesFileText)
currentFiles = indexesFileText currentFiles = indexesFileText
indexesFile.close() indexesFile.close()
end end
print("#DEBUG currentFiles " .. currentFiles) --print("#DEBUG currentFiles " .. currentFiles)
local updateResult = http.post(updateUrl, currentFiles) local updateResult = http.post(updateUrl, currentFiles)
if updateResult == nil then if updateResult == nil then
@ -75,7 +75,7 @@ local function getAllFiles(program)
error() error()
end end
local updateText = updateResult.readAll() local updateText = updateResult.readAll()
print("#DEBUG updateText" .. updateText) --print("#DEBUG updateText" .. updateText)
local updateTable = split(updateText, "\n") local updateTable = split(updateText, "\n")
local indexesResult = http.get(indexesUrl) local indexesResult = http.get(indexesUrl)
@ -84,7 +84,7 @@ local function getAllFiles(program)
error() error()
end end
local indexesText = indexesResult.readAll() local indexesText = indexesResult.readAll()
print("#DEBUG indexesText" .. indexesText) --print("#DEBUG indexesText" .. indexesText)
local indexesTable = split(indexesText, "\n") local indexesTable = split(indexesText, "\n")
local newIndexesFile = fs.open(path .. program .. "/indexes.dat", "w") local newIndexesFile = fs.open(path .. program .. "/indexes.dat", "w")