diff options
author | Robin Jarry <robin@jarry.cc> | 2023-08-23 21:36:23 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-08-27 18:44:12 +0200 |
commit | a5bc7ccf0cae608ac1e72ab4c9ebe5596eb8c988 (patch) | |
tree | be2e5f55fc21980489dca61947ea6b9819853ec3 /worker/notmuch | |
parent | fff16640ad7cd8c4b73187fbce10f2aa558701be (diff) | |
download | aerc-a5bc7ccf0cae608ac1e72ab4c9ebe5596eb8c988.tar.gz |
xdg: get rid of deprecated dependencies
github.com/mitchellh/go-homedir has not received any update since 2019.
The last release of github.com/kyoh86/xdg was in 2020 and it has been
marked as deprecated by its author.
Replace these with internal functions.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'worker/notmuch')
-rw-r--r-- | worker/notmuch/worker.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 85f813da..73aa0efe 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -20,13 +20,13 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/watchers" + "git.sr.ht/~rjarry/aerc/lib/xdg" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" "git.sr.ht/~rjarry/aerc/worker/lib" notmuch "git.sr.ht/~rjarry/aerc/worker/notmuch/lib" "git.sr.ht/~rjarry/aerc/worker/types" - "github.com/mitchellh/go-homedir" ) func init() { @@ -208,10 +208,7 @@ func (w *worker) handleConfigure(msg *types.Configure) error { w.w.Errorf("error configuring notmuch worker: %v", err) return err } - home, err := homedir.Expand(u.Hostname()) - if err != nil { - return fmt.Errorf("could not resolve home directory: %w", err) - } + home := xdg.ExpandHome(u.Hostname()) pathToDB := filepath.Join(home, u.Path) err = w.loadQueryMap(msg.Config) if err != nil { @@ -222,11 +219,7 @@ func (w *worker) handleConfigure(msg *types.Configure) error { val, ok := msg.Config.Params["maildir-store"] if ok { - path, err := homedir.Expand(val) - if err != nil { - return err - } - + path := xdg.ExpandHome(val) w.maildirAccountPath = msg.Config.Params["maildir-account-path"] path = filepath.Join(path, w.maildirAccountPath) @@ -607,10 +600,7 @@ func (w *worker) loadQueryMap(acctConfig *config.AccountConfig) error { // nothing to do return nil } - file, err := homedir.Expand(raw) - if err != nil { - return err - } + file := xdg.ExpandHome(raw) f, err := os.Open(file) if err != nil { return err |