fix(lib): TypeError in extractEntry function for zip

This commit is contained in:
Erica Marigold 2025-01-16 08:48:03 +00:00
parent 4da1e25967
commit f4f05b8264
Signed by: DevComp
GPG key ID: 429EF1C337871656

View file

@ -46,7 +46,7 @@ local extractBinary: {
local reader = unzip.load(compressed) local reader = unzip.load(compressed)
local binaryContents: buffer? local binaryContents: buffer?
--- Extracts a specific entry from the ZIP and validates that its `PlatformDescriptor` --- Extracts a specific entry from the ZIP and validates that its `PlatformDescriptor`
--- matches the expected one --- matches the expected one
local function extractEntry(entry: unzip.ZipEntry): buffer? local function extractEntry(entry: unzip.ZipEntry): buffer?
local contents = reader:extract(entry, { type = "binary" }) :: buffer local contents = reader:extract(entry, { type = "binary" }) :: buffer
@ -55,8 +55,9 @@ local extractBinary: {
if executablePlatform:isOk() and eq(executablePlatform:unwrap(), targetPlatform) then if executablePlatform:isOk() and eq(executablePlatform:unwrap(), targetPlatform) then
return contents return contents
end end
end
return nil
end
-- Find the entry and attempt to extract it -- Find the entry and attempt to extract it
local binaryEntry = reader:findEntry(binaryName) local binaryEntry = reader:findEntry(binaryName)