Skip to content

Commit 9d982f2

Browse files
committed
fix(sea-builder): remove erroneous closing brace causing syntax error
Fixed "Illegal return statement" syntax error introduced when adding bootstrap rebuild code. Removed spurious closing brace and fixed indentation of spawn call and error handling.
1 parent fd77fff commit 9d982f2

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

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

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -517,31 +517,30 @@ async function buildTarget(target, options) {
517517
getDefaultLogger().log('')
518518

519519
const result = await spawn(
520-
'pnpm',
521-
['--filter', '@socketsecurity/bootstrap', 'run', 'build'],
522-
{
523-
cwd: path.join(__dirname, '../../..'),
524-
shell: WIN32,
525-
stdio: 'inherit',
526-
}
527-
)
528-
529-
if (result.code !== 0) {
530-
throw new Error(
531-
`Failed to build @socketsecurity/bootstrap. Exit code: ${result.code}`,
532-
)
533-
}
520+
'pnpm',
521+
['--filter', '@socketsecurity/bootstrap', 'run', 'build'],
522+
{
523+
cwd: path.join(__dirname, '../../..'),
524+
shell: WIN32,
525+
stdio: 'inherit',
526+
},
527+
)
534528

535-
// Verify bootstrap was built.
536-
if (!existsSync(bootstrapPath)) {
537-
throw new Error(
538-
`Bootstrap build succeeded but file not found at ${bootstrapPath}`,
539-
)
540-
}
529+
if (result.code !== 0) {
530+
throw new Error(
531+
`Failed to build @socketsecurity/bootstrap. Exit code: ${result.code}`,
532+
)
533+
}
541534

542-
getDefaultLogger().log('')
535+
// Verify bootstrap was built.
536+
if (!existsSync(bootstrapPath)) {
537+
throw new Error(
538+
`Bootstrap build succeeded but file not found at ${bootstrapPath}`,
539+
)
543540
}
544541

542+
getDefaultLogger().log('')
543+
545544
getDefaultLogger().log(`Using bootstrap from: ${bootstrapPath}`)
546545

547546
// Read the bootstrap code.

0 commit comments

Comments
 (0)