From: Don Armstrong Date: Sun, 7 May 2006 07:50:22 +0000 (+0000) Subject: add a hook-only mode to sa X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=commitdiff_plain;h=456efdbf580a40471c6f1bc439cb02a7f8a33b56 add a hook-only mode to sa --- diff --git a/sa b/sa index 6772c51..0baa728 100755 --- a/sa +++ b/sa @@ -56,9 +56,10 @@ my %options = (quick => 1, help => 0, man => 0, verbose => 0, + hooks_only => 0, ); -GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+'); +GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+','hooks_only|hooks-only'); pod2usage() if $options{help}; pod2usage({verbose=>2}) if $options{man}; @@ -127,8 +128,8 @@ else { } while (my ($repo,$run_after) = each(%repos)) { - if (-e "$repo/.svn") { - print "Checking [$repo]\n"; + print "Checking [$repo]\n"; + if (-e "$repo/.svn" and not $options{hooks_only}) { system('svn', $command, (not $VERBOSE and $options{quiet})?'-q':(), @@ -138,7 +139,7 @@ while (my ($repo,$run_after) = each(%repos)) { $repo, ); } - if ($command =~ /^up(?:date)|checkout$/) { + if ($command =~ /^up(?:date)?|checkout$/) { system('sh', '-c',"$run_after $repo") if defined $run_after and length $run_after; } }