From 9af34671bd18d459a9d77a84736b914fe878e662 Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Tue, 16 Nov 2021 14:12:24 +0900 Subject: [PATCH] revert dir rename --- download/proxy.go | 7 ++++++- handlers/checks.go | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/download/proxy.go b/download/proxy.go index a2d6441..894f44d 100644 --- a/download/proxy.go +++ b/download/proxy.go @@ -85,5 +85,10 @@ func ProxyDownload(path string) (string, error) { return "", err } - return mv.Version, os.Rename(filepath.Join(reposDir, lowerPath+"@"+mv.Version), filepath.Join(reposDir, path)) + err = os.Rename(filepath.Join(reposDir, path+"@"+mv.Version), filepath.Join(reposDir, path)) + if err != nil { + return "", err + } + + return mv.Version, nil } diff --git a/handlers/checks.go b/handlers/checks.go index aaa4bf2..2a2274a 100644 --- a/handlers/checks.go +++ b/handlers/checks.go @@ -98,7 +98,8 @@ func newChecksResp(db *badger.DB, repo string, forceRefresh bool) (checksResp, e ver, err := download.ProxyDownload(repo) if err != nil { - return checksResp{}, fmt.Errorf("could not download repo: %v", err) + log.Println("ERROR:", err) + // return checksResp{}, fmt.Errorf("could not download repo: %v", err) } // repo = repoRoot.Root