Minor changes to manifest format
This commit is contained in:
@@ -10,12 +10,14 @@ local basicFiles = { "Launch.lua", "Update.lua" }
|
||||
local xml = require("xml")
|
||||
local curl = require("lcurl")
|
||||
|
||||
local localSource
|
||||
local localBranch, localSource
|
||||
local localManXML = xml.LoadXMLFile("manifest.xml")
|
||||
if localManXML and localManXML[1].elem == "PoBVersion" then
|
||||
for _, node in ipairs(localManXML[1]) do
|
||||
if type(node) == "table" then
|
||||
if node.elem == "Source" then
|
||||
if node.elem == "Version" then
|
||||
localBranch = node.attrib.branch
|
||||
elseif node.elem == "Source" then
|
||||
if node.attrib.part == "program" then
|
||||
localSource = node.attrib.url
|
||||
end
|
||||
@@ -23,10 +25,11 @@ if localManXML and localManXML[1].elem == "PoBVersion" then
|
||||
end
|
||||
end
|
||||
end
|
||||
if not localSource then
|
||||
if not localBranch or not localSource then
|
||||
Exit("Install failed. (Missing or invalid manifest)")
|
||||
return
|
||||
end
|
||||
localSource = localSource:gsub("{branch}", localBranch)
|
||||
for _, name in pairs(basicFiles) do
|
||||
local outFile = io.open(name, "wb")
|
||||
local easy = curl.easy()
|
||||
|
||||
Reference in New Issue
Block a user