Repository navigation
Fail the build when a command exits non-zero - #19
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_commandcaptured output, ignored the exit status, and its rescue calledexception.class.message. That method is not defined on the class, so the handler raisedNoMethodError.rake deploystill 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.rbpasses, including a failinglatexmk, a DOCX path with a space, and a failingpandoc.DOCBLD_REAL_LATEX=1 ruby test/deploy_test.rb --name test_real_latexmk_compiles_a_documentcompiled a real article and published a non-empty PDF.