-- dl.lua
-- download from git repo
-- usage:
--- dl repo[:tag] remote/path:local/path[:o] [remote/path:local/path[:o] ...]
+-- dl repo[:tag] remote/path:local/path[:o] [remote/path:local/path[:o] ...] -- downloads from git repo
+-- dl live remote/path:local/path[:o] [remote/path:local/path[:o] ...] -- downloads from live repo
local args = {...}
local repo = ""
end
for _, file in pairs(files) do
- local url = "https://git.olavbs.no/?p="..repo..".git;a=blob_plain;f="..file.from..";hb="..tag
+ if repo = "live" then
+ local url = "https://cc.olavbs.no/live/"..file.from
+ else
+ local url = "https://git.olavbs.no/?p="..repo..".git;a=blob_plain;f="..file.from..";hb="..tag
+ end
if fs.exists(file.to) and file.overwrite then
local tmp = textutils.serialize(math.random(100000,999999))
local ok = shell.run("wget "..url.." "..tmp)
-- install.lua
--- looks for package-file in git repo and runs dl.lua on every line
+-- looks for package-file in repo and runs dl.lua on every line
-- usage:
--- install repo:[tag] remote/path
+-- install repo:[tag] remote/path install package from git repo
+-- install live remote/path install package from live repo
+
local args = {...}
+
+local repo = args[1]
+local path = args[2]
+
+local live = repo == "live"
+
local tmp = textutils.serialize(math.random(100000,999999))
-shell.run("dl "..args[1].." "..args[2].."/package:"..tmp)
+shell.run("dl "..repo.." "..path.."/package:"..tmp)
local file = fs.open(tmp, "r")
for line in file.readLine do
- shell.run("dl "..line)
+ if live then
+ shell.run("dl "..string.gsub(line, "^.-%s+", "live "))
+ else
+ shell.run("dl "..line)
+ end
end
fs.delete(tmp)