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 /commands/history.go | |
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 'commands/history.go')
-rw-r--r-- | commands/history.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/history.go b/commands/history.go index 7aa42fab..cc85f3ba 100644 --- a/commands/history.go +++ b/commands/history.go @@ -6,11 +6,10 @@ import ( "fmt" "io" "os" - "path" "sync" + "git.sr.ht/~rjarry/aerc/lib/xdg" "git.sr.ht/~rjarry/aerc/log" - "github.com/kyoh86/xdg" ) type cmdHistory struct { @@ -92,9 +91,9 @@ func (h *cmdHistory) initialize() { var err error openFlags := os.O_RDWR | os.O_EXCL - histPath := path.Join(xdg.CacheHome(), "aerc", "history") + histPath := xdg.CachePath("aerc", "history") if _, err := os.Stat(histPath); os.IsNotExist(err) { - _ = os.MkdirAll(path.Join(xdg.CacheHome(), "aerc"), 0o700) // caught by OpenFile + _ = os.MkdirAll(xdg.CachePath("aerc"), 0o700) // caught by OpenFile openFlags |= os.O_CREATE } |