Skip to content

Commit 34939d6

Browse files
committed
fix: handle StaticSitesClient stderr and non-zero exit codes
The deploy command silently ignored failures from the StaticSitesClient binary. When the binary crashed (e.g., missing native dependencies on slim Docker images), the CLI reported success and exited with code 0. This fix: - Adds stderr handler to capture binary error output - Adds else branch for non-zero exit codes with diagnostic message - Calls process.exit(1) on failure so CI/CD detects it Fixes #536, #594 Refs: ICM 21000000909499
1 parent 59d315d commit 34939d6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/cli/commands/deploy/deploy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,13 @@ export async function deploy(options: SWACLIConfig) {
315315
});
316316
});
317317

318+
child.stderr!.on("data", (data) => {
319+
const stderrOutput = data.toString().trim();
320+
if (stderrOutput) {
321+
logger.error(stderrOutput);
322+
}
323+
});
324+
318325
child.on("error", (error) => {
319326
logger.error(error.toString());
320327
});
@@ -325,6 +332,12 @@ export async function deploy(options: SWACLIConfig) {
325332
if (code === 0) {
326333
spinner.succeed(chalk.green(`Project deployed to ${chalk.underline(projectUrl)} 🚀`));
327334
logger.log(``);
335+
} else {
336+
spinner.fail(chalk.red(`Deployment failed with exit code ${code}`));
337+
logger.error(`The deployment binary exited with code ${code}.`);
338+
logger.error(`If you are running in a minimal container image, ensure native dependencies are installed.`);
339+
logger.error(`Run ${chalk.cyan(`ldd ${binary}`)} to check for missing shared libraries.`);
340+
process.exit(1);
328341
}
329342
});
330343
}

0 commit comments

Comments
 (0)