fix: correct rojo sync config paths

This commit is contained in:
daimond113 2024-10-20 13:36:44 +02:00
parent a737b56704
commit fb32d66cc6
Signed by untrusted user who does not match committer: DevComp
GPG key ID: 429EF1C337871656
3 changed files with 15 additions and 5 deletions

View file

@ -1,5 +1,5 @@
local process = require("@lune/process")
local fs = require("@lune/fs") local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde") local serde = require("@lune/serde")
local package_directory = process.args[1] local package_directory = process.args[1]
@ -20,7 +20,7 @@ for i, file in process.args do
local name = string.gsub(file, ".luau?$", "") local name = string.gsub(file, ".luau?$", "")
if name == "init" then if name == "init" then
output["$path"] = file output.tree["$path"] = file
continue continue
end end
@ -29,8 +29,16 @@ for i, file in process.args do
} }
end end
if not output["$path"] then if not output.tree["$path"] then
output["$className"] = "Folder" output.tree["$className"] = "Folder"
end
if not output.tree["roblox_packages"] then
output.tree["roblox_packages"] = {
["$path"] = {
optional = "roblox_packages",
},
}
end end
fs.writeFile(package_directory .. "/default.project.json", serde.encode("json", output, true)) fs.writeFile(package_directory .. "/default.project.json", serde.encode("json", output, true))

View file

@ -1,5 +1,5 @@
local process = require("@lune/process")
local fs = require("@lune/fs") local fs = require("@lune/fs")
local process = require("@lune/process")
local stdio = require("@lune/stdio") local stdio = require("@lune/stdio")
local package_directory = process.args[1] local package_directory = process.args[1]

2
stylua.toml Normal file
View file

@ -0,0 +1,2 @@
[sort_requires]
enabled = true