fix: use new script format

This commit is contained in:
daimond113 2024-08-12 01:15:04 +02:00
parent a0e6de8d6b
commit c6d9f2e6cf
Signed by untrusted user who does not match committer: DevComp
GPG key ID: 429EF1C337871656
2 changed files with 16 additions and 3 deletions

View file

@ -2,13 +2,17 @@ local process = require("@lune/process")
local fs = require("@lune/fs")
local serde = require("@lune/serde")
local package_directory = process.cwd
local package_directory = process.args[1]
local output = {
tree = {},
}
for _, file in process.args do
for i, file in process.args do
if i == 1 then
continue
end
local name = string.gsub(file, ".luau?$", "")
if name == "init" then

View file

@ -1,3 +1,12 @@
local process = require("@lune/process")
local fs = require("@lune/fs")
local stdio = require("@lune/stdio")
process.spawn("rojo", { "sourcemap" }, { cwd = process.cwd, stdio = "forward" })
local project_path = process.args[1]
if fs.isFile(project_path .. "/default.project.json") then
process.spawn("rojo", { "sourcemap", project_path }, { cwd = process.cwd, stdio = "forward" })
else
-- use stderr to avoid this being parsed as the output of the sourcemap command
stdio.ewrite("no default.project.json found in " .. project_path)
end