OSDN Git Service

patch for win32/gui
[jnethack/source.git] / DEVEL / gitinfo.pl
1 #!/usr/bin/perl
2 # NetHack 3.6  getinfo.pl       $NHDT-Date: 1524689669 2018/04/25 20:54:29 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.2 $
3 # Copyright (c) 2018 by Michael Allison
4 # NetHack may be freely redistributed.  See license for details.
5
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 = '\\';
22     }
23     $gitdir = `git rev-parse --git-dir`;
24     chomp $gitdir;
25     push(@INC, $gitdir.$PDS."hooks");
26
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");
31     }
32     chdir("..") if (-f "hooksdir/NHgithook.pm");
33 }
34 use NHgithook;
35
36 &NHgithook::nhversioning;