Skip to content

Commit de0a7e6

Browse files
committed
fix(build): correct spawn result access in build orchestration scripts
Fix incorrect spawn result property access in build and validation scripts. Changed result.status to result.code throughout. Files fixed: - scripts/build-all-binaries.mjs - scripts/build-all-from-source.mjs - scripts/pre-publish-validate.mjs These scripts orchestrate multi-platform builds and package validation. Using undefined result.status caused incorrect error detection and exit codes.
1 parent 4924e94 commit de0a7e6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

scripts/build-all-binaries.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ async function exec(command, args, options = {}) {
7878
...options,
7979
})
8080

81-
if (result.status !== 0) {
82-
throw new Error(`Command failed with exit code ${result.status}`)
81+
if (result.code !== 0) {
82+
throw new Error(`Command failed with exit code ${result.code}`)
8383
}
8484

8585
return result

scripts/build-all-from-source.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ async function buildPackage(pkg) {
102102
stdio: 'inherit',
103103
})
104104

105-
if (result.status !== 0) {
106-
throw new Error(`Build failed with exit code ${result.status}`)
105+
if (result.code !== 0) {
106+
throw new Error(`Build failed with exit code ${result.code}`)
107107
}
108108

109109
const duration = Math.round((Date.now() - startTime) / 1000)

scripts/pre-publish-validate.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async function checkGitStatus() {
295295
cwd: projectRoot,
296296
})
297297

298-
if (result.status !== 0) {
298+
if (result.code !== 0) {
299299
warnings.push('Unable to check git status')
300300
return { errors, warnings }
301301
}
@@ -336,7 +336,7 @@ async function validateGitTag() {
336336
cwd: projectRoot,
337337
})
338338

339-
if (result.status !== 0) {
339+
if (result.code !== 0) {
340340
warnings.push('Unable to check git tags')
341341
return { errors, warnings }
342342
}

0 commit comments

Comments
 (0)