Small install.lua fix

Small fix to the web version
This commit is contained in:
Robert Jelic
2022-10-31 00:41:57 +01:00
parent a74b8a3d9f
commit b34cdd8383

View File

@@ -263,14 +263,16 @@ function installer.generateWebVersion(file, version)
local f = fs.open(file, "w")
local link = "https://basalt.madefor.cc/versions/"..version
local content = 'local request = http.get("'..link..'", _G._GIT_API_KEY and {Authorization = "token ".._G._GIT_API_KEY})\n'
content = content..[[
content = content..
[[
if(request~=nil)then
return load(request.readAll())()
else
error("Unable to connect to ]]..link..[[)
error("Unable to connect to ]]..link..[[")
end
]]
f:write(content)
]]
f.write(content)
f.close()
end
else
error("Version doesn't exist!")
@@ -378,6 +380,8 @@ if(#args>0)then
installer.downloadProject(args[2] or "basalt", args[3] or "master", args[4]~=nil and installer.createIgnoreList(args[4]) or nil)
elseif(string.lower(args[1])=="web")then
installer.generateWebVersion(args[3] or "basaltWeb.lua", args[2] or "latest.lua")
elseif(string.lower(args[1])=="file")then
installer.download("https://basalt.madefor.cc/versions/"..args[2] or "latest.lua", args[3] or "basalt.lua")
end
end