-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
38 lines (34 loc) · 954 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
local init = {}
local shell = require("shell")
function init.getfiles(gotFilesList)
print("initializing files...")
local repo
for line in io.lines(os.getenv("PWD") .. "/init.files") do
if repo == nil then
repo = line
if not gotFilesList then
-- restart, got file listing that may have changed
init.clone(repo, true)
return
end
print("repo " .. repo)
else
print("getting " .. line)
os.execute("wget -f https://raw.githubusercontent.com/" .. repo .. "/master/" .. line ..
"?" .. math.random() .. " " .. line)
end
end
print("done")
end
function init.clone(repo, gotFilesList)
os.execute("wget -f https://raw.githubusercontent.com/" .. repo .. "/master/init.files?"
.. math.random() .. " init.files")
init.getfiles(gotFilesList)
end
local args = shell.parse( ... )
if args[1] ~= nil then
init.clone(args[1], false)
else
init.getfiles()
end
return init