mirror of
https://github.com/LDDestroier/CC/
synced 2025-03-06 11:38:10 +00:00
Update netrequire.lua
This commit is contained in:
parent
abaeacb041
commit
9f730abab4
@ -13,12 +13,19 @@ local function netrequire(_name, alwaysDownload, ...)
|
|||||||
local url = "https://github.com/LDDestroier/CC/raw/master/netrequire/" .. name
|
local url = "https://github.com/LDDestroier/CC/raw/master/netrequire/" .. name
|
||||||
local net = http.get(url)
|
local net = http.get(url)
|
||||||
if net then
|
if net then
|
||||||
local contents = net.readAll()
|
url = net.readLine()
|
||||||
net.close()
|
net.close()
|
||||||
local file = fs.open(fs.combine(DL_path, name), "w")
|
net = http.get(url)
|
||||||
file.write(contents)
|
if net then
|
||||||
file.close()
|
local contents = net.readAll()
|
||||||
return loadstring(contents)(...)
|
net.close()
|
||||||
|
local file = fs.open(fs.combine(DL_path, name), "w")
|
||||||
|
file.write(contents)
|
||||||
|
file.close()
|
||||||
|
return loadstring(contents)(...)
|
||||||
|
else
|
||||||
|
error("Couldn't connect to '" .. url .. "'")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
error("Cannot find any such API '" .. name .. "'")
|
error("Cannot find any such API '" .. name .. "'")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user