mirror of
https://github.com/pesde-pkg/scripts.git
synced 2025-01-19 01:28:05 +00:00
32 lines
575 B
Text
32 lines
575 B
Text
local process = require("@lune/process")
|
|
local fs = require("@lune/fs")
|
|
local serde = require("@lune/serde")
|
|
|
|
local package_directory = process.args[1]
|
|
|
|
local output = {
|
|
tree = {},
|
|
}
|
|
|
|
for i, file in process.args do
|
|
if i == 1 then
|
|
continue
|
|
end
|
|
|
|
local name = string.gsub(file, ".luau?$", "")
|
|
|
|
if name == "init" then
|
|
output["$path"] = file
|
|
continue
|
|
end
|
|
|
|
output.tree[name] = {
|
|
["$path"] = file,
|
|
}
|
|
end
|
|
|
|
if not output["$path"] then
|
|
output["$className"] = "Folder"
|
|
end
|
|
|
|
fs.writeFile(package_directory .. "/default.project.json", serde.encode("json", output, true))
|