mirror of
https://github.com/Adorable-Catgirl/Zorya-NEO.git
synced 2024-12-23 17:38:07 +11:00
Utils
This commit is contained in:
parent
1cf9e94b54
commit
c012911f36
@ -182,7 +182,7 @@ local tmpfile = os.tmpname()
|
||||
local tmpf = io.open(tmpfile, "wb")
|
||||
tmpf:write(env.code)
|
||||
tmpf:close()
|
||||
if (os.execute("luamin -f "..tmpfile.." > "..arg[2])) then
|
||||
if (os.execute("luamin -f "..tmpfile..">"..arg[2])) then
|
||||
os.execute("stat -c \"Output: %s bytes\" "..arg[2])
|
||||
else
|
||||
io.stderr:write("Error: ")
|
2
utils/mkmod.sh
Executable file
2
utils/mkmod.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
ls $1 | cpio -oD $1 > $2.zyr 2>/dev/null
|
39
utils/mkrelease.lua
Executable file
39
utils/mkrelease.lua
Executable file
@ -0,0 +1,39 @@
|
||||
if (not os.execute("stat .git>/dev/null 2>&1")) then
|
||||
io.stderr:write("This script must be executed at the root (run utils/mkrelease.lua)\n")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
os.execute("mkdir -p build/modules")
|
||||
os.execute("mkdir -p build/loaders")
|
||||
os.execute("mkdir -p build/microruntime")
|
||||
|
||||
local cwd = os.getenv("PWD")
|
||||
|
||||
local function dir(path, func)
|
||||
local h = io.popen("ls "..path, "r")
|
||||
for line in h:lines() do
|
||||
func(line)
|
||||
end
|
||||
end
|
||||
|
||||
print("Building modules...")
|
||||
dir("src/modules", function(entry)
|
||||
print("MOD", entry)
|
||||
os.execute("utils/mkmod.sh src/modules/"..entry.." build/"..entry)
|
||||
end)
|
||||
|
||||
print("Building loaders...")
|
||||
dir("src/loaders", function(entry)
|
||||
print("LOADER", entry)
|
||||
os.execute("cd src/loaders/"..entry.."; "..cwd.."/utils/luapreproc.lua init.lua "..cwd.."/build/loaders/"..entry..".bios>/dev/null")
|
||||
end)
|
||||
|
||||
print("Building microruntimes...")
|
||||
dir("src/microruntime", function(entry)
|
||||
print("URT", entry)
|
||||
os.execute("cd src/microruntime/"..entry.."; "..cwd.."/utils/luapreproc.lua init.lua "..cwd.."/build/microruntime/"..entry..".urt>/dev/null")
|
||||
end)
|
||||
|
||||
print("Packing...")
|
||||
os.execute("cd build; find * -depth | cpio -o > ../update.zy2 2>/dev/null")
|
||||
print("Packaging complete. See update.zy2.")
|
Loading…
Reference in New Issue
Block a user