]> Sergey Matveev's repositories - public-inbox.git/commitdiff
drop needless `eval {}' around Config->new
authorEric Wong <e@yhbt.net>
Mon, 20 Apr 2020 09:33:38 +0000 (09:33 +0000)
committerEric Wong <e@yhbt.net>
Mon, 20 Apr 2020 20:20:49 +0000 (20:20 +0000)
It hasn't been needed since commit 089cca37fa036411
("config: ignore missing config files").  And we
actually want to propagate errors when we can't
start new processes or if git(1) is missing.

lib/PublicInbox/Admin.pm
script/public-inbox-convert
script/public-inbox-edit

index 336b7d4cbf2ee536445072a1bef1fe4534bf894f..60f4f40dcba838cda0ea581e7fa226f371fd7bf9 100644 (file)
@@ -71,7 +71,7 @@ sub resolve_inboxes ($;$$) {
        my ($argv, $opt, $cfg) = @_;
        $opt ||= {};
 
-       $cfg //= eval { PublicInbox::Config->new };
+       $cfg //= PublicInbox::Config->new;
        if ($opt->{all}) {
                my $cfgfile = PublicInbox::Config::default_file();
                $cfg or die "--all specified, but $cfgfile not readable\n";
index e13c13f44153ed1f29082a10f80317c229574422..4c220b364bf30417c0fd745b663887b3adcc7f4a 100755 (executable)
@@ -24,7 +24,7 @@ my $old_dir = shift(@ARGV) or die $usage;
 my $new_dir = shift(@ARGV) or die $usage;
 die "$new_dir exists\n" if -d $new_dir;
 die "$old_dir not a directory\n" unless -d $old_dir;
-my $config = eval { PublicInbox::Config->new };
+my $config = PublicInbox::Config->new;
 $old_dir = abs_path($old_dir);
 my $old;
 if ($config) {
index 28b1b5e827a38abc9069a00e8df6db23651d6689..42f914a808d73413f12b7c3499b3b40c862c1f2c 100755 (executable)
@@ -22,7 +22,7 @@ my @opt = qw(mid|m=s file|F=s raw);
 GetOptions($opt, @PublicInbox::AdminEdit::OPT, @opt) or
        die "bad command-line args\n$usage\n";
 
-my $cfg = eval { PublicInbox::Config->new };
+my $cfg = PublicInbox::Config->new;
 my $editor = $ENV{MAIL_EDITOR}; # e.g. "mutt -f"
 unless (defined $editor) {
        my $k = 'publicinbox.mailEditor';