Skip to content

Commit

Permalink
dont download if file already present
Browse files Browse the repository at this point in the history
if a file is already i the file system and it validates, we do not need to download it again.
  • Loading branch information
777Denoiser committed Dec 4, 2024
1 parent d4a4c74 commit 25dae22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func GetUrlToDir(u string, targetDir string, ctx context.Context) (string, error
h := sha256.New()
h.Write([]byte(u))
fileName := filepath.Join(targetDir, fmt.Sprintf(".%s", hex.EncodeToString(h.Sum(nil))))
return getUrl(u, filename, ctx)
return getUrl(u, fileName, ctx)
}

// GetUrlWithDir downloads the given resource to a temporary file and returns the path to it.
Expand Down

0 comments on commit 25dae22

Please sign in to comment.