gitinfo.pl: special case code to allow running it from $TOP or DEVEL without

installing the hooks first
NHgithook.pm: add some warnings if nhversioning can't open files
make sure nhversioning fails before opening gitinfo.txt if it can't get valid
 data
This commit is contained in:
keni
2018-02-09 11:48:04 -05:00
parent 65655d2cee
commit cf9cf038f3
6 changed files with 20 additions and 5 deletions

View File

@@ -20,6 +20,13 @@ BEGIN {
$gitdir = `git rev-parse --git-dir`;
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
# special case for this script only: allow
# it to run from DEVEL or $TOP
if (-f "hooksdir/NHgithook.pm" || -f "DEVEL/hooksdir/NHgithook.pm"){
push(@INC, "DEVEL/hooksdir");
}
chdir("..") if (-f "hooksdir/NHgithook.pm");
}
use NHgithook;