Skip to content

Commit 39d74f2

Browse files
ChristophLHRColdIV
andcommitted
Removed downloadURL function
Co-authored-by: Josh <[email protected]>
1 parent 04ec0d6 commit 39d74f2

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

libs/scm/net.lua

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -192,42 +192,6 @@ do
192192
return nil, false
193193
end
194194

195-
---@param sourceObject table
196-
---@param targetDirectory string
197-
---@param updateObj table | nil
198-
---@return table | nil
199-
---@return boolean
200-
function Net:downloadURL(sourceObject, targetDirectory, updateObj)
201-
local sourceName = "default" or (updateObj and updateObj.sourceName)
202-
if updateObj then
203-
sourceObject.name = sourceObject.name or updateObj.name
204-
end
205-
206-
if not sourceObject.name then
207-
sourceObject.name = self:getNameFromURL(sourceObject.source[sourceName])
208-
end
209-
local request = http.get(sourceObject.source[sourceName])
210-
211-
if request then
212-
local content = request.readAll()
213-
request.close()
214-
215-
if content then
216-
local file = fs.open(targetDirectory .. sourceObject.name, "w")
217-
if not file then
218-
os.execute("mkdir " .. targetDirectory)
219-
file = fs.open(targetDirectory .. sourceObject.name, "w")
220-
end
221-
file.write(content)
222-
file.close()
223-
224-
return sourceObject, true
225-
end
226-
end
227-
228-
return nil, false
229-
end
230-
231195
---@param url string
232196
---@return string
233197
function Net:getNameFromURL(url)

0 commit comments

Comments
 (0)