public class CommandHook extends Object implements Serializable
Optional element used to attach system commands to run before or after a Zanata command (the "hooked command"). The hooked command is specified in the "command" attribute.
Include <hook>
elements within a <hooks>
element in the
<config>
element of zanata.xml. Each command should have zero or one
hooks. Each hook can have any number of <before>
and <after>
elements.
Commands specified in <before>
elements will be run before the hooked
command, in the order that they are specified. Commands specified in
<after>
elements are similarly run in order after the hooked command
successfully completes. If any command fails, including the hooked command,
no further commands will be run.
<hooks>
<hook command="push">
<before>po4a-gettextize -f man -m manpage.1 -p manpage.pot</before>
<after>rm -f manpage.pot</after>
</hook>
<hook command="pull">
<after>po4a-translate -f man -m manpage.1 -p trans/de/manpage.po -l manpage.de.1 --keep 1</after>
<after>rm -rf trans</after>
</hook>
</hooks>
Constructor and Description |
---|
CommandHook() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getAfters() |
List<String> |
getBefores() |
String |
getCommand() |
void |
setCommand(String command) |
String |
toString() |
Copyright © 2018 Zanata Project. All rights reserved.