about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-04-16 16:10:28 -0700
committerEric Wong <e@80x24.org>2021-04-16 22:24:47 -0400
commitbc7f9e3322a36b7aa42b273fd82d1c1da7b69b00 (patch)
tree2cd34e58c2fce36f41936db7b7fc2fe4731954d2 /lib
parent2e4e4b0d6f30d9d4612066395ba694c7c7d61e6e (diff)
downloadpublic-inbox-bc7f9e3322a36b7aa42b273fd82d1c1da7b69b00.tar.gz
Since saved-searches aren't a part of lei/store, nor
could it be considered cache data... (or can it? it
is discardable, after all).
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LEI.pm6
-rw-r--r--lib/PublicInbox/LeiSavedSearch.pm2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 4b87c104..52b588a2 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -83,13 +83,15 @@ sub rel2abs ($$) {
         File::Spec->rel2abs($p, $pwd);
 }
 
-sub store_path ($) {
+sub share_path ($) { # $HOME/.local/share/lei/$FOO
         my ($self) = @_;
         rel2abs($self, ($self->{env}->{XDG_DATA_HOME} //
                 ($self->{env}->{HOME} // '/nonexistent').'/.local/share')
-                .'/lei/store');
+                .'/lei');
 }
 
+sub store_path ($) { share_path($_[0]) . '/store' }
+
 sub _config_path ($) {
         my ($self) = @_;
         rel2abs($self, ($self->{env}->{XDG_CONFIG_HOME} //
diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm
index e79cf76a..fe8301d6 100644
--- a/lib/PublicInbox/LeiSavedSearch.pm
+++ b/lib/PublicInbox/LeiSavedSearch.pm
@@ -23,7 +23,7 @@ sub new {
                         return $lei->fail("$f non-existent or unreadable");
                 $self->{-cfg} = PublicInbox::Config::git_config_dump($f);
         } else { # new saved search "lei q --save"
-                my $saved_dir = $lei->store_path . '/../saved-searches/';
+                my $saved_dir = $lei->share_path . '/saved-searches/';
                 my (@name) = ($lei->{ovv}->{dst} =~ m{([\w\-\.]+)/*\z});
                 my $q = $lei->{mset_opt}->{q_raw} // die 'BUG: {q_raw} missing';
                 my $q_raw_str = ref($q) ? "@$q" : $q;