tags:

views:

66

answers:

1

I've got several (in this case, pre-commit) hooks that I would like to have run during the same event. Right now, they are all just shell-scripts, so I know I could just concatenate them to get them all to run. In the future though, additional scripts may be written in Perl, PHP, or some other language as well.

How can I run several different scripts as part of a single hook, and have any one failure of the sub-hooks, fail as expected?

+1  A: 

You can just invoke each script from the single pre-commit script in SVN:

#!/bin/sh

sh do_this.sh
php do_that.php
...

You don't even need to mention the executable names (sh or php) if you use a proper shebang in your scripts.

Bram Schoenmakers
the exit(1) (or 0) from the success/failure of the individual tests do not propagate out of the sub-tests though, so the entire set of tests either return the default 0, or whatever else may be returned from the top-level script.
Alister Bulman