mirror of
https://github.com/pesde-pkg/scripts.git
synced 2024-12-12 07:00:35 +00:00
fix(sourcemap_generator): support no default.project.json init.luau packages
This commit is contained in:
parent
fb32d66cc6
commit
5e5b3efc78
1 changed files with 4 additions and 0 deletions
|
@ -1,11 +1,15 @@
|
|||
local fs = require("@lune/fs")
|
||||
local process = require("@lune/process")
|
||||
local serde = require("@lune/serde")
|
||||
local stdio = require("@lune/stdio")
|
||||
|
||||
local package_directory = process.args[1]
|
||||
|
||||
if fs.isFile(package_directory .. "/default.project.json") then
|
||||
process.spawn("rojo", { "sourcemap", package_directory }, { cwd = process.cwd, stdio = "forward" })
|
||||
elseif fs.isFile(package_directory .. "/init.luau") then
|
||||
local sourcemap = { filePaths = { "init.luau" } }
|
||||
stdio.write(serde.encode("json", sourcemap, false))
|
||||
else
|
||||
-- use stderr to avoid this being parsed as the output of the sourcemap command
|
||||
stdio.ewrite("no default.project.json found in " .. package_directory)
|
||||
|
|
Loading…
Reference in a new issue