1package Minilla::Release::RunHooks;
2use strict;
3use warnings;
4use utf8;
5
6sub run {
7    my ($self, $project, $opts) = @_;
8
9    my $return_value = 0;
10    my $commands     = $project->config->{release}->{hooks};
11
12    if ($commands) {
13        if (ref $commands ne 'ARRAY') {
14            warn "Release hooks must be array";
15            exit 1;
16        }
17        $return_value = system(join ' && ', @$commands);
18    }
19
20    if ($return_value != 0) {
21        # Failure executing command of hooks
22        exit 1;
23    }
24}
25
261;
27
28