Skip to content

Commit

Permalink
feat: omit tests script
Browse files Browse the repository at this point in the history
  • Loading branch information
wad4444 committed May 4, 2024
1 parent 5b72d16 commit e535f72
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"luau-lsp.sourcemap.rojoProjectFile": "dev.project.json",
"luau-lsp.types.definitionFiles": ["bin/testez.d.luau"],
"luau-lsp.types.definitionFiles": ["bin/testez.d.luau"],"luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.directoryAliases": {
"@lune/": "~/.lune/.typedefs/0.8.3/"
}
}
1 change: 1 addition & 0 deletions aftman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rojo = "rojo-rbx/[email protected]"
selene = "kampfkarren/[email protected]"
wally = "UpliftGames/[email protected]"
wally-package-types = "JohnnyMorganz/[email protected]"
lune = "lune-org/[email protected]"
3 changes: 2 additions & 1 deletion scripts/build-with-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
set -e

bash scripts/install-packages.sh
rojo build -o refx.rbxm withDeps.project.json
rojo build -o refx.rbxm withDeps.project.json
lune run scripts/omit-tests.luau refx.rbxm
22 changes: 22 additions & 0 deletions scripts/omit-tests.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local process = require("@lune/process")
local fs = require("@lune/fs")
local roblox = require("@lune/roblox")

local args = process.args
local fileName = args[1]
assert(fileName, "Missing filename!")

local modelFile = fs.readFile(fileName)
local instances = roblox.deserializeModel(modelFile)

for i, instance in instances do
for k, descendant in instance:GetDescendants() do
if string.find(descendant.Name, ".spec") then
print(`Omitting {descendant.Name}`)
descendant:Destroy()
end
end
end

local newFile = roblox.serializeModel(instances)
fs.writeFile(fileName, newFile)

0 comments on commit e535f72

Please sign in to comment.