chore(lune): only use process.exit on error to prevent lune panic

This commit is contained in:
Erica Marigold 2024-12-08 12:33:31 +00:00
parent c94110ced9
commit 8ac67b89cf
Signed by: DevComp
GPG key ID: 429EF1C337871656

View file

@ -27,14 +27,17 @@ local SCRIPTS = {
local args = table.clone(process.args) local args = table.clone(process.args)
local ok, _ = local ok, _ =
require("./lune_packages/core").generators.%s.syncConfig(table.remove(args, 1), args, { writeToFile = true }) require("./lune_packages/core").generators.%s.syncConfig(table.remove(args, 1), args, { writeToFile = true })
if not ok then
process.exit(tonumber(ok))]], return process.exit(1)
end]],
sourcemapGenerator = [[local process = require("@lune/process") sourcemapGenerator = [[local process = require("@lune/process")
return process.exit( local ok = require("./lune_packages/core").generators.%s.sourcemap(process.args[1])
tonumber(require("./lune_packages/core").generators.%s.sourcemap(process.args[1])) if not ok then
)]], return process.exit(1)
end
]],
} }
local function logPrefix(type: "error" | "info") local function logPrefix(type: "error" | "info")