Commit d2d6cfcd authored by Robert Ricci's avatar Robert Ricci

Change path handling in git-multihook

If the path is not explictly fully-qualified or relative, prepend
the path this script itself is at (usually hooks/)
parent 5da66347
......@@ -28,6 +28,12 @@ my $CONFIGBASE = "hooks.multihook";
my $whichhook = `basename '$0'`;
chomp($whichhook);
#
# Figure out path to the hook directory
#
my $hookpath = `dirname '$0'`;
chomp $hookpath;
my $configvar = $CONFIGBASE . "." . $whichhook;
#
......@@ -53,6 +59,12 @@ my @inputlines = <STDIN>;
# No real error checking for now.
#
foreach my $script (@scripts) {
if ($script !~ /^\.|\//) {
# Relative paths get the hook directory pre-pended
$script = "$hookpath/$script";
}
open(SCRIPT,"| $script");
print SCRIPT @inputlines;
close(SCRIPT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment