This commit is contained in:
2025-09-24 17:50:37 -04:00
6 changed files with 57 additions and 4 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
-- handles core detection logic for workspace in models
local roblox = require("@lune/roblox")
local stdio = require("@lune/stdio")
local serde = require("@lune/serde")
local types = require("./types")
local compression = require("./compression")
export type Core = {
scanForWorkspace: (model: {Instance}, printInstanceNames: boolean) -> boolean,
scanForWorkspace: (model: types.model, printInstanceNames: boolean) -> boolean,
isValidModelFile: (fileName: string) -> boolean,
fileContainsWorkspace: (fileContents: string, opts: types.opts) -> boolean,
formatResult: (result: boolean, fileName: string) -> string
@@ -40,7 +40,7 @@ function core.fileContainsWorkspace(fileContents: string, opts: types.opts): boo
assert(typeof(fileContents) == "string", "Expected fileContents to be of type 'string'")
assert(typeof(opts) == "table", "Expected opts to be of type 'table'")
if opts.zlibDecompressFiles then
local success = pcall(function() fileContents = serde.decompress("zlib", fileContents) end)
local success = pcall(function() fileContents = compression.zlibDecompress(fileContents, opts.zlibDecompressFilesRecursive) end)
if not success then
stdio.write(stdio.color("yellow"))
stdio.write("Warning: Failed to decompress file with zlib. Proceeding with original contents.\n")