From 4d747ebde6542a2f77ebb5f00237970b74228b5e Mon Sep 17 00:00:00 2001 From: Chloe M Date: Sun, 16 Aug 2026 18:01:23 -0500 Subject: core: bop+hook: Handle errors within hooks Signed-off-by: Chloe M --- core/bop.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/bop.c') diff --git a/core/bop.c b/core/bop.c index f495649..e144bb2 100644 --- a/core/bop.c +++ b/core/bop.c @@ -68,7 +68,7 @@ static int run_build(const char *build_dir, build_op_t bop) { char pathbuf[256]; - int error; + int error = 0; /* * There is a pre-build hook to be located within the [BUILD_DIR]/.bop/prehook.sh which @@ -78,7 +78,9 @@ run_build(const char *build_dir, build_op_t bop) if (bop != BUILD_OP_CLEAN) { snprintf(pathbuf, sizeof(pathbuf), "%s/.bop/prehook.sh", build_dir); if (access(pathbuf, F_OK) == 0) - bop_shell_hook(pathbuf); + error = bop_shell_hook(pathbuf); + if (error != 0) + return error; } error = bop_build_dir(build_dir, bop); @@ -91,7 +93,9 @@ run_build(const char *build_dir, build_op_t bop) if (bop != BUILD_OP_CLEAN) { snprintf(pathbuf, sizeof(pathbuf), "%s/.bop/posthook.sh", build_dir); if (access(pathbuf, F_OK) == 0) - bop_shell_hook(pathbuf); + error = bop_shell_hook(pathbuf); + if (error != 0) + return error; } return 0; -- cgit v1.2.3