Add proper failure detection to PDF build script
Track PDF generation failures and exit with non-zero code if any PDFs fail to build. This ensures CI properly detects build failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
19
build-pdf.sh
19
build-pdf.sh
@@ -9,6 +9,9 @@ DOCS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
OUTPUT_DIR="${DOCS_DIR}/pdf-output"
|
||||
PANDOC_DIR="${DOCS_DIR}/pandoc"
|
||||
|
||||
# Track build failures
|
||||
BUILD_FAILURES=0
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -118,6 +121,7 @@ build_user_quickstart() {
|
||||
echo -e "${GREEN} Created: ${output}${NC}"
|
||||
else
|
||||
echo -e "${RED} Failed to create: ${output}${NC}"
|
||||
((BUILD_FAILURES++))
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -149,6 +153,7 @@ build_user_complete() {
|
||||
echo -e "${GREEN} Created: ${output}${NC}"
|
||||
else
|
||||
echo -e "${RED} Failed to create: ${output}${NC}"
|
||||
((BUILD_FAILURES++))
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -180,6 +185,7 @@ build_developer_guide() {
|
||||
echo -e "${GREEN} Created: ${output}${NC}"
|
||||
else
|
||||
echo -e "${RED} Failed to create: ${output}${NC}"
|
||||
((BUILD_FAILURES++))
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -211,6 +217,7 @@ build_api_reference() {
|
||||
echo -e "${GREEN} Created: ${output}${NC}"
|
||||
else
|
||||
echo -e "${RED} Failed to create: ${output}${NC}"
|
||||
((BUILD_FAILURES++))
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -246,6 +253,7 @@ build_technical_manual() {
|
||||
echo -e "${GREEN} Created: ${output}${NC}"
|
||||
else
|
||||
echo -e "${RED} Failed to create: ${output}${NC}"
|
||||
((BUILD_FAILURES++))
|
||||
fi
|
||||
|
||||
rm -f "${temp_combined}"
|
||||
@@ -293,8 +301,15 @@ main() {
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo "Build complete. Output in: ${OUTPUT_DIR}"
|
||||
echo "========================================"
|
||||
if [[ ${BUILD_FAILURES} -gt 0 ]]; then
|
||||
echo -e "${RED}Build completed with ${BUILD_FAILURES} failure(s)${NC}"
|
||||
echo "========================================"
|
||||
exit 1
|
||||
else
|
||||
echo -e "${GREEN}Build complete. Output in: ${OUTPUT_DIR}${NC}"
|
||||
echo "========================================"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user