From: Olav Bakke Svendsen Date: Tue, 17 Oct 2023 22:04:31 +0000 (+0200) Subject: Fixes X-Git-Tag: stable-steam~6 X-Git-Url: http://git.olavbs.no/?a=commitdiff_plain;h=08daad71afe0b87e3e4533e18f979810323959d9;p=cc.git Fixes --- diff --git a/common/dl.lua b/common/dl.lua index 5eb2e81..e6b7f9f 100644 --- a/common/dl.lua +++ b/common/dl.lua @@ -3,13 +3,13 @@ -- usage: -- dl repo[:tag] remote/path:local/path[:o] [remote/path:local/path[:o] ...] -local args = table.unpack({...}) +local args = {...} local repo = "" local tag = "" local files = {} do local repotag = table.remove(args, 1) - repo, tag = string.match(args[1], "^([^:]+):?(.*)$") + repo, tag = string.match(repotag, "^([^:]+):?(.*)$") if tag == "" then tag = "HEAD" end for _, file in pairs(args) do local from, rest = string.match(file, "^/?([^:%s]+):?(.*)$") @@ -20,16 +20,16 @@ do end for _, file in pairs(files) do - local url = "https://git.olavbs.no/?p="..repo..".git;a=blob_plain;f="..from..";hb="..tag + local url = "https://git.olavbs.no/?p="..repo..".git;a=blob_plain;f="..file.from..";hb="..tag if fs.exists(file.to) and file.overwrite then local tmp = textutils.serialize(math.random(100000,999999)) - local ok = shell.run("wget "..file.from.." "..tmp) + local ok = shell.run("wget "..url.." "..tmp) if ok then print("Overwriting "..file.to) fs.delete(file.to) fs.move(tmp,file.to) end else - shell.run("wget "..file.from.." "..file.to) + shell.run("wget "..url.." "..file.to) end end