diff --git a/lune/rojo/roblox_sync_config_generator.luau b/lune/rojo/roblox_sync_config_generator.luau index 30cfe38..63e41ba 100644 --- a/lune/rojo/roblox_sync_config_generator.luau +++ b/lune/rojo/roblox_sync_config_generator.luau @@ -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 diff --git a/lune/rojo/sourcemap_generator.luau b/lune/rojo/sourcemap_generator.luau index 1951e9d..a4c6a79 100644 --- a/lune/rojo/sourcemap_generator.luau +++ b/lune/rojo/sourcemap_generator.luau @@ -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