Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append success/failure commands of latexmk instead of overwriting. #2076

Merged
merged 1 commit into from Jun 24, 2021
Merged

Append success/failure commands of latexmk instead of overwriting. #2076

merged 1 commit into from Jun 24, 2021

Conversation

Nicholas42
Copy link
Contributor

Append success and failure callbacks to success_cmd and failure_cmd instead of overwriting them. This allows to use them in a latexmkrc-file, where right now they are overwritten and hence not executed. This fixes #1237.

I introduce a function wrap_append_cmd_option that only differs from wrap_option by

  1. using .= instead of = which is appending in perl
  2. adding a ; before the appended value. This separates shell commands. It is no problem if the variable was empty beforehand.

I am unsure if this works correctly on windows since I never did scripting there and do not know if ; has the same effect. One could easily use the old variant for windows if this does not work.

The change only influences success_cmd and failure_cmd since I did not change wrap_option here. In my opinion overwriting is the right thing to do at the other places it is used.

@lervag lervag merged commit 0c4f8da into lervag:master Jun 24, 2021
@lervag
Copy link
Owner

lervag commented Jun 24, 2021

Thanks! I don't see any reason not to merge this. And I appreciate your contribution!

lervag added a commit that referenced this pull request Jun 25, 2021
This reverts the change introduced by PR #2076.

refer: #2078, #2076
@lervag
Copy link
Owner

lervag commented Jun 25, 2021

See #2078: I've had to revert this, because it breaks things when the ; becomes the leading part of a command.

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.

latexmk callback commands (e.g. success_cmd) not respected
2 participants