]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiExternal.pm
lei add-external: don't allow non-existent directories
[public-inbox.git] / lib / PublicInbox / LeiExternal.pm
index e7693e09a7de67a427742590707926352e54aed0..bf07c41cf7215e01d02cc0e3b949f6958184a816 100644 (file)
@@ -58,6 +58,9 @@ sub lei_add_external {
        my $cfg = $self->_lei_cfg(1);
        my $new_boost = $self->{opt}->{boost} // 0;
        $location = _canonicalize($location);
+       if ($location !~ m!\Ahttps?://! && !-d $location) {
+               return $self->fail("$location not a directory");
+       }
        my $key = "external.$location.boost";
        my $cur_boost = $cfg->{$key};
        return if defined($cur_boost) && $cur_boost == $new_boost; # idempotent