Skip to content

Commit 8e45dee

Browse files
committed
fix(packages): correct spawn result access in package build scripts
Fix incorrect spawn result property access in package-specific build scripts. Changed result.exitCode and result.status to result.code. Files fixed: - packages/node-sea-builder/scripts/build.mjs (result.exitCode → result.code) - packages/cli/scripts/wasm.mjs (result.status → result.code) - packages/minilm-builder/scripts/build.mjs (result.status → result.code) The @socketsecurity/lib/spawn function returns {code, stdout?, stderr?}. Using incorrect property names resulted in undefined checks and broken builds.
1 parent de0a7e6 commit 8e45dee

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/cli/scripts/wasm.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ async function exec(command, args, options = {}) {
115115
...options,
116116
})
117117

118-
if (result.status !== 0) {
119-
throw new Error(`Command failed with exit code ${result.status}`)
118+
if (result.code !== 0) {
119+
throw new Error(`Command failed with exit code ${result.code}`)
120120
}
121121

122122
return {
123-
code: result.status ?? 0,
123+
code: result.code ?? 0,
124124
stderr: result.stderr ?? '',
125125
stdout: result.stdout ?? '',
126126
}

packages/minilm-builder/scripts/build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ async function runPythonScript(scriptName, args, options = {}) {
312312
throw new Error(result.error)
313313
}
314314

315-
if (result.status && result.status !== 'complete') {
316-
printStep(` ${result.status.replace(/_/g, ' ')}...`)
315+
if (result.code && result.code !== 'complete') {
316+
printStep(` ${result.code.replace(/_/g, ' ')}...`)
317317
}
318318
} catch (e) {
319319
if (e.message.startsWith('{')) {

packages/node-sea-builder/scripts/build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ async function buildSeaBlob(nodeBinary, configPath) {
325325
result &&
326326
typeof result === 'object' &&
327327
'exitCode' in result &&
328-
result.exitCode !== 0
328+
result.code !== 0
329329
) {
330-
throw new Error(`Failed to generate SEA blob: exit code ${result.exitCode}`)
330+
throw new Error(`Failed to generate SEA blob: exit code ${result.code}`)
331331
}
332332

333333
return blobPath

0 commit comments

Comments
 (0)