From 184affd7d56db168754e3942c9ae9e012e6babd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 30 Jul 2015 20:59:57 -0700 Subject: [PATCH] Adapt code to new basedir --- cmd/fdroidcl/main.go | 16 ++++++++-------- cmd/fdroidcl/update.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/fdroidcl/main.go b/cmd/fdroidcl/main.go index eb63f05..0dd0c36 100644 --- a/cmd/fdroidcl/main.go +++ b/cmd/fdroidcl/main.go @@ -28,23 +28,23 @@ func subdir(dir, name string) string { } func mustCache() string { - dir, err := basedir.Cache() - if err != nil { - log.Fatalf("Could not determine cache dir: %v", err) + dir := basedir.Cache() + if dir == "" { + log.Fatalf("Could not determine cache dir") } return subdir(dir, cmdName) } -func mustConfig() string { - dir, err := basedir.Config() - if err != nil { - log.Fatalf("Could not determine config dir: %v", err) +func mustData() string { + dir := basedir.Data() + if dir == "" { + log.Fatalf("Could not determine data dir") } return subdir(dir, cmdName) } func configPath() string { - return filepath.Join(mustConfig(), "config.json") + return filepath.Join(mustData(), "config.json") } type repo struct { diff --git a/cmd/fdroidcl/update.go b/cmd/fdroidcl/update.go index 407ca27..d91d0d7 100644 --- a/cmd/fdroidcl/update.go +++ b/cmd/fdroidcl/update.go @@ -128,7 +128,7 @@ func downloadEtag(url, path string, sum []byte) error { } func indexPath(name string) string { - return filepath.Join(mustConfig(), name+".jar") + return filepath.Join(mustData(), name+".jar") } func mustLoadIndexes() []fdroidcl.App {