-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.lua
61 lines (54 loc) · 1.14 KB
/
install.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
local packages = {
buffer = true;
class = true;
clipboard = true;
draw = true;
drawable = true;
filesystem = true;
graphics = true;
IEEE754 = true;
lex = true;
network = true;
peripheral = true;
process = true;
sha256 = true;
sutils = true;
time = true;
tween = true;
}
if not fs.isDir ".package" then
local h = http.get "https://raw.githubusercontent.com/awsumben13/Package-API/master/install.lua"
if h then
local content = h.readAll()
h.close()
local f, err = loadstring( content, "installer" )
if f then
f()
else
print( err )
return
end
else
print "Couldn't download package API"
return
end
end
local package = dofile ".package/api.lua"
local function download( package )
package.install( package, "https://raw.githubusercontent.com/awsumben13/Misc-Packages/master/build/" .. package )
end
print "What packages would you like to install? (* for all, separate with space):"
local p = read()
if p == "*" then
for k, v in pairs( packages ) do
download( k )
end
else
for pack in p:gmatch "([%w_]+)" do
if packages[pack] then
download( pack )
else
error( "No such package " .. pack, 0 )
end
end
end