Skip to content

Commit

Permalink
i hate the github app for converting tabs to single spaces when the w…
Browse files Browse the repository at this point in the history
…ebsite editor doesnt
  • Loading branch information
gaymeowing authored Dec 19, 2024
1 parent 997d1f0 commit ff44230
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions scripts/release/libinfo.luau
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,30 @@ local FORMAT = string.format
local FREEZE = table.freeze

local function libinfo(lib: string): LibInfo
local cached = CACHED_INFOS[lib]
local cached = CACHED_INFOS[lib]

if cached then
return cached
else
local raw: InternalLibInfo = serde.decode("toml", fs.readFile(FORMAT(LIBINFO_PATH_FORMAT, lib)))
local runtime = raw.runtime

if runtime then
if type(runtime) == "string" then
runtime = { main = runtime }
else
local optional = runtime.optional

if optional then
FREEZE(optional)
end
end
raw.runtime = FREEZE(runtime)
end

CACHED_INFOS[lib] = FREEZE(raw) :: any
return raw :: any
if cached then
return cached
else
local raw: InternalLibInfo = serde.decode("toml", fs.readFile(FORMAT(LIBINFO_PATH_FORMAT, lib)))
local runtime = raw.runtime

if runtime then
if type(runtime) == "string" then
runtime = { main = runtime }
else
local optional = runtime.optional

if optional then
FREEZE(optional)
end
end
raw.runtime = FREEZE(runtime)
end

CACHED_INFOS[lib] = FREEZE(raw) :: any
return raw :: any
end
end

return libinfo
return libinfo

0 comments on commit ff44230

Please sign in to comment.