From 08daad71afe0b87e3e4533e18f979810323959d9 Mon Sep 17 00:00:00 2001 From: Olav Bakke Svendsen Date: Wed, 18 Oct 2023 00:04:31 +0200 Subject: [PATCH] Fixes --- common/dl.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.30.2