-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.lua
More file actions
53 lines (50 loc) · 1.13 KB
/
build.lua
File metadata and controls
53 lines (50 loc) · 1.13 KB
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
local toInclude = {
"bigfont.lua",
"browser-script.lua",
"browser.lua",
"logger.lua",
"networking.lua",
"primeui.lua",
"tags.lua",
"xmlLib.lua",
"tags/"
}
local outputFile = "browser.bundle.lua"
local version = "2025.4.0"
local function packFolder(path,dat)
if (path:find("/") ~= #path) then
print("Building "..path)
local f = fs.open(path,'r')
if (f == nil) then
error('file not found: '..path)
end
dat[path] = f.readAll()
f.close()
else
local l = fs.list(path)
for k,v in ipairs(l) do
packFolder(path..'/'..v,dat)
end
end
end
local files = {}
for k,v in ipairs(toInclude) do
packFolder(v,files)
end
local output = fs.open(outputFile,'w')
output.write("local version='"..version.."';")
output.write("local files=")
output.write(textutils.serialize(files))
output.write(
'print("Installing CCML Browser v"..version);'..
'local p="/"..shell.dir().."/";'..
'for k,v in pairs(files) do;'..
'print("Extracting:"..p..k);'..
'local f=fs.open(p..k,"w");'..
'f.write(v);'..
'f.close();'..
'end;'..
'print("Done!")'
)
output.close()
print("Build complete")