]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-compact
Merge remote-tracking branch 'origin/danga-bundle'
[public-inbox.git] / script / public-inbox-compact
index 5f18497e6b57558963e30562565d3c2798836202..d22e40323dfef08b513aea2d8a4c95f0137dc5a1 100755 (executable)
@@ -13,12 +13,14 @@ use File::Path qw(remove_tree);
 use PublicInbox::Spawn qw(spawn);
 my $usage = "Usage: public-inbox-compact REPO_DIR\n";
 my $dir = shift or die $usage;
-my $config = PublicInbox::Config->new;
+my $config = eval { PublicInbox::Config->new };
 my $ibx;
 $dir = abs_path($dir);
-$config->each_inbox(sub {
-       $ibx = $_[0] if abs_path($_[0]->{mainrepo}) eq $dir
-});
+if ($config) {
+       $config->each_inbox(sub {
+               $ibx = $_[0] if abs_path($_[0]->{mainrepo}) eq $dir
+       });
+}
 unless ($ibx) {
        warn "W: $dir not configured in ".
                PublicInbox::Config::default_file() . "\n";