]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
lei: All Local Externals: bare git dir for alternates
[public-inbox.git] / lib / PublicInbox / LEI.pm
index d20ba7448663ddf6a28e18625245264bd5d9c94b..0da26a32825755c7f3534d2c50b9c70e04fc06f0 100644 (file)
@@ -97,6 +97,22 @@ sub _config_path ($) {
                .'/lei/config');
 }
 
+sub cache_dir ($) {
+       my ($self) = @_;
+       rel2abs($self, ($self->{env}->{XDG_CACHE_HOME} //
+               ($self->{env}->{HOME} // '/nonexistent').'/.cache')
+               .'/lei');
+}
+
+sub ale {
+       my ($self) = @_;
+       $self->{ale} //= do {
+               require PublicInbox::LeiALE;
+               PublicInbox::LeiALE->new(cache_dir($self).
+                                       '/all_locals_ever.git');
+       };
+}
+
 sub index_opt {
        # TODO: drop underscore variants everywhere, they're undocumented
        qw(fsync|sync! jobs|j=i indexlevel|L=s compact