about summary refs log tree commit homepage
path: root/script/public-inbox-compact
diff options
context:
space:
mode:
Diffstat (limited to 'script/public-inbox-compact')
-rwxr-xr-xscript/public-inbox-compact10
1 files changed, 6 insertions, 4 deletions
diff --git a/script/public-inbox-compact b/script/public-inbox-compact
index 5f18497e..d22e4032 100755
--- a/script/public-inbox-compact
+++ b/script/public-inbox-compact
@@ -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";