Skip to content

Commit

Permalink
Remove basedir implementation
Browse files Browse the repository at this point in the history
Go added native support for finding the config directory via
`os.UserConfigDir()`, so no need for a custom implementation with the
potantial of becomming outdated/wrong over time.
  • Loading branch information
jugendhacker committed Jul 14, 2023
1 parent 3e1a1c1 commit ab9f898
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 60 deletions.
35 changes: 0 additions & 35 deletions basedir/basedir.go

This file was deleted.

6 changes: 0 additions & 6 deletions basedir/basedir_darwin.go

This file was deleted.

8 changes: 0 additions & 8 deletions basedir/basedir_unix.go

This file was deleted.

6 changes: 0 additions & 6 deletions basedir/basedir_windows.go

This file was deleted.

8 changes: 3 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"os"
"path/filepath"
"strings"

"mvdan.cc/fdroidcl/basedir"
)

const cmdName = "fdroidcl"
Expand All @@ -36,9 +34,9 @@ func mustCache() string {
}

func mustData() string {
dir := basedir.Data()
if dir == "" {
fmt.Fprintln(os.Stderr, "Could not determine data dir")
dir, err := os.UserConfigDir()
if err != nil {
fmt.Fprintln(os.Stderr, err)
panic("TODO: return an error")
}
return subdir(dir, cmdName)
Expand Down

0 comments on commit ab9f898

Please sign in to comment.