Skip to content

Fail the build when a command exits non-zero - #19

Merged
Traap merged 1 commit into
masterfrom
issue/15-fail-on-command-failure
Dec 1, 2026
Merged

Traap merged 1 commit into
masterfrom
issue/15-fail-on-command-failure

Conversation

@Traap

@Traap Traap commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Closes #15

Principle: Fix Root Causes - command status is part of the build result, so the task stops when the tool exits non-zero.

run_command captured output, ignored the exit status, and its rescue called exception.class.message. That method is not defined on the class, so the handler raised NoMethodError. rake deploy still printed that distribution had completed.

The PDF and DOCX rules now call Rake's sh. Output stays on the terminal. A non-zero status aborts the task before the success line.

Verification

ruby test/deploy_test.rb passes, including a failing latexmk, a DOCX path with a space, and a failing pandoc.

DOCBLD_REAL_LATEX=1 ruby test/deploy_test.rb --name test_real_latexmk_compiles_a_document compiled a real article and published a non-empty PDF.

Use rake's sh so latexmk, htlatex, and pandoc show their output
and a non-zero status stops the task. The old runner discarded
the status and could not report the exception it rescued.
@Traap
Traap merged commit 24474ad into master Dec 1, 2026
1 check passed
@Traap
Traap deleted the issue/15-fail-on-command-failure branch December 1, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail the build when a compile command fails

1 participant