From 7bd9239d94a5371eacf001766de9c2d53b7fde43 Mon Sep 17 00:00:00 2001 From: Vitaly Ovchinnikov Date: Tue, 7 Nov 2023 16:14:01 +0000 Subject: {im,ex}port-mbox: allow using ~ in path Add ~ support to :export-mbox and :import-box the same way as it is done in :save. Signed-off-by: Vitaly Ovchinnikov Acked-by: Robin Jarry --- commands/account/import-mbox.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands/account/import-mbox.go') diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 7aa393b6..e326edce 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -11,6 +11,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/xdg" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" @@ -48,6 +49,8 @@ func (i ImportMbox) Execute(args []string) error { return errors.New("No directory selected") } + i.Filename = xdg.ExpandHome(i.Filename) + importFolder := func() { defer log.PanicHandler() statusInfo := fmt.Sprintln("Importing", i.Filename, "to folder", folder) -- cgit