if ($#ARGV < 0);
sub doit {
- my ($cmd) = shift;
+ my ($cmd, $repo) = @_;
my $rc;
my $outfile = "/tmp/github-send-email-tmp.$$";
unlink($outfile);
$rc = system("$cmd >$outfile 2>&1");
if (0 != $rc) {
- print "Command failed: $cmd
+ print "Command failed:
+
+Command: $cmd
+Repo: $repo
Output:\n";
open(IN, $outfile);
print $_
die "Could not chdir to $src_repo"
if (getcwd() != $src_repo);
- doit("/u/mpiteam/git/local/bin/git fetch");
- doit("/u/mpiteam/git/local/bin/git push email");
+ doit("/u/mpiteam/git/local/bin/git fetch", $src_repo);
+ doit("/u/mpiteam/git/local/bin/git push email", $src_repo);
}