summaryrefslogtreecommitdiffstats
path: root/src/lib/Gitolite/Triggers/Motd.pm
blob: 6de80a2cc34b21cfa0654177edc72ac59e404e4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Gitolite::Triggers::Motd;

use Gitolite::Rc;
use Gitolite::Common;

use strict;
use warnings;

# print a message of the day to STDERR
# ----------------------------------------------------------------------

my $file = "gl-motd";

sub input {
    # at present, we print it for every single interaction with gitolite.  We
    # may want to change that later; if we do, get code from Kindergarten.pm
    # to get the gitcmd+repo or cmd+args so you can filter on them

    my $f = "$rc{GL_ADMIN_BASE}/$file";
    print STDERR slurp($f) if -f $f;
}

sub pre_git {
    my $repo = $_[1];
    my $f    = "$rc{GL_REPO_BASE}/$repo.git/$file";
    print STDERR slurp($f) if -f $f;
}

1;