-
Notifications
You must be signed in to change notification settings - Fork 2
CommandLineInstruction element
Markus Hastreiter edited this page Mar 23, 2019
·
1 revision
The <CommandLineInstruction> element is used to call external command line programs, batch files, etc.
When executed as pre-commit hook, the exit code of the called program is checked. If the called program exits with an exit code other than 0 the commit will fail. But there are programs that return exit codes other than 0 even if everything is fine. Therefore, the expected exit code (the exit code with which the commit is ok) can be specified via the ExpectedExitCode attribute. When executed as post-commit hook, the exit code of the called program is ignored.
| Attribute name | Status | Default | Description |
|---|---|---|---|
| FileName | mandatory | The path and filename of the called program. Note that it is important to specify the full path as hooks (at least in subversion) can't use environment variables like %PATH%. | |
| Arguments | optional | These arguments are handed to the called program. If you need quote characters use " instead (e.g. for -m "info" you would write the following Arguments attribute: -Arguments="-m "info"") | |
| ExpectedExitCode | optional | 0 | If the program exits with an exit code other than this exit code the commit will fail (only applies to pre-commit). |
| TimeoutInMilliseconds | optional | 60000 | A timeout used when executing to called program. Use 0 for infinite timeout. |
| NewLineReplacement | optional | "" | A character or string which will replace Environment.NewLine in the executed command line. |
<!-- Add commit to ReviewBoard -->