Implement proper error handling and some minor fixes I guess #3

Merged
Blendi merged 6 commits from :main into main 2026-05-24 12:08:08 +02:00
Showing only changes of commit 19e8e1356b - Show all commits

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env lua
-- i love build scripts i love build scripts i love build scripts scripts build love i script build love me i love script build i script love build
local args = {...}
local isBlendi = os.getenv("USER") == "blendi"
local separator = package.config:sub(1,1)
@@ -30,7 +28,7 @@ local function fixPath(path)
return new
end
if args[1] == "clean" then
if arg[1] == "clean" then
if separator == '\\' then
runCommand("rmdir /s /q build 2>nul")
else
@@ -98,7 +96,7 @@ for i = 1,#files do
if needsRebuild(fname, out) then
needsLinking = true
runCommand('clang -c -o ' .. out .. ' ' .. fname .. ' ' .. table.concat(coolArgs, ' '))
runCommand('clang -g -c -o ' .. out .. ' ' .. fname .. ' ' .. table.concat(coolArgs, ' '))
end
objects[#objects+1] = out;
@@ -107,9 +105,9 @@ end
local exe = separator == '\\' and ".\\noom.exe" or "./noom"
if needsLinking then
runCommand('clang -o ' .. exe .. ' ' .. table.concat(objects, ' ') .. ' ' .. table.concat(coolArgs, ' '))
runCommand('clang -g -o ' .. exe .. ' ' .. table.concat(objects, ' ') .. ' ' .. table.concat(coolArgs, ' '))
end
if args[1] == "run" then
if arg[1] == "run" then
runCommand(exe)
end