From c6d9f2e6cfc934db19e21d2b52dc5ad02d198638 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:15:04 +0200 Subject: [PATCH] fix: use new script format --- lune/rojo/roblox_sync_config_generator.luau | 8 ++++++-- lune/rojo/sourcemap_generator.luau | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) 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