fix typo reported in b9ff8068 from Sept 2024
[NetHack.git] / DEVEL / gitinfo.pl
blobf348f8e6ea6068f83d5760fda99d6832783eacb6
1 #!/usr/bin/perl
2 # NetHack 3.7 getinfo.pl $NHDT-Date: 1596498266 2020/08/03 23:44:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
3 # Copyright (c) 2018 by Michael Allison
4 # NetHack may be freely redistributed. See license for details.
6 #STARTUP-START
7 BEGIN {
8 # OS hackery has to be duplicated in each of the hooks :/
9 # first the directory separator
10 my $DS = quotemeta('/');
11 my $PDS = '/';
12 # msys: POSIXish over a Windows filesystem (so / not \ but \r\n not \n).
13 # temporarily removed because inconsistent behavior
14 # if ($^O eq "msys")
15 # {
16 # $/ = "\r\n";
17 # $\ = "\r\n";
18 # }
19 if($^O eq "MSWin32"){
20 $DS = quotemeta('\\');
21 $PDS = '\\';
23 $gitdir = `git rev-parse --git-dir`;
24 chomp $gitdir;
25 push(@INC, $gitdir.$PDS."hooks");
27 # special case for this script only: allow
28 # it to run from DEVEL or $TOP
29 if (-f "hooksdir/NHgithook.pm" || -f "DEVEL/hooksdir/NHgithook.pm"){
30 push(@INC, "DEVEL/hooksdir");
32 chdir("..") if (-f "hooksdir/NHgithook.pm");
34 use NHgithook;
36 &NHgithook::nhversioning;