* [PATCH 2/2] lei: improve idempotent "init" error message
2021-01-04 4:16 6% [PATCH 0/2] lei: some usage bits Eric Wong
@ 2021-01-04 4:16 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-01-04 4:16 UTC (permalink / raw)
To: meta
Showing "leistore.dir= already initialized" because $cur is
undefined isn't useful.
---
lib/PublicInbox/LEI.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 50453dde..9a3b1ee3 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -505,7 +505,7 @@ sub lei_init {
$dir //= _store_path($env);
$dir = File::Spec->rel2abs($dir, $env->{PWD}); # PWD is symlink-aware
my @cur = stat($cur) if defined($cur);
- $cur = File::Spec->canonpath($cur) if $cur;
+ $cur = File::Spec->canonpath($cur // $dir);
my @dir = stat($dir);
my $exists = "I: leistore.dir=$cur already initialized" if @dir;
if (@cur) {
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] lei: some usage bits
@ 2021-01-04 4:16 6% Eric Wong
2021-01-04 4:16 7% ` [PATCH 2/2] lei: improve idempotent "init" error message Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-01-04 4:16 UTC (permalink / raw)
To: meta
Still trying to wrap my head around xsearch but my head hurts :<
Eric Wong (2):
lei: fix opt_dash to pass non-dash args to @argv
lei: improve idempotent "init" error message
lib/PublicInbox/LEI.pm | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-04 4:16 6% [PATCH 0/2] lei: some usage bits Eric Wong
2021-01-04 4:16 7% ` [PATCH 2/2] lei: improve idempotent "init" error message Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).