From c3b19985ec84b1ccb707f659f2dea84dd48faa02 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 6 Mar 2018 11:26:29 -0800 Subject: [PATCH] projtool.pl: show 'has_global_hooks' => 1 etc. when applicable Along with the other information computed especially for the "show" command, indicate whether or not the project has a core.hookspath pointing to Girocco's global hooks directory. In addition, if the hooksPath value is set and is not the canonical value for either the local or global hooks path include it too as a 'hookspath' value. Signed-off-by: Kyle J. McKay --- toolbox/projtool.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/toolbox/projtool.pl b/toolbox/projtool.pl index a3a6cd6..b1b31e3 100755 --- a/toolbox/projtool.pl +++ b/toolbox/projtool.pl @@ -272,10 +272,17 @@ sub get_clean_project { $project->{tags} = \@tags if @tags; my $projconfig = read_config_file_hash($project->{path}."/config"); if (defined($projconfig) && defined($projconfig->{"core.hookspath"})) { - my $rhp = realpath($projconfig->{"core.hookspath"}); - my $php = realpath($project->{path}."/hooks"); + my $ahp = $projconfig->{"core.hookspath"}; + my $rahp = realpath($ahp); + my $lhp = $project->{path}."/hooks"; + my $rlhp = realpath($lhp); + my $ghp = $Girocco::Config::reporoot."/_global/hooks"; + my $rghp = realpath($ghp); $project->{has_local_hooks} = 1 if - defined($rhp) && defined($php) && $rhp eq $php; + defined($rahp) && defined($rlhp) && $rahp eq $rlhp; + $project->{has_global_hooks} = 1 if + defined($rahp) && defined($rghp) && $rahp eq $rghp; + $project->{hookspath} = $ahp unless $ahp eq $lhp || $ahp eq $ghp; } $project; } -- 2.11.4.GIT