chore: pass all options to download
All checks were successful
Pre-commit / pre-commit (pull_request) Successful in 5m26s
Update alr-git / changelog (push) Successful in 24s

This commit is contained in:
2025-06-25 19:52:54 +03:00
parent 5e1eeabd04
commit 401c41160c
4 changed files with 16 additions and 26 deletions

View File

@ -172,15 +172,10 @@ func Download(ctx context.Context, opts Options) (err error) {
"downloader", d.Name(),
)
updated, err = d.Update(Options{
Hash: opts.Hash,
HashAlgorithm: opts.HashAlgorithm,
Name: opts.Name,
URL: opts.URL,
Destination: cacheDir,
Progress: opts.Progress,
LocalDir: opts.LocalDir,
})
newOpts := opts
newOpts.Destination = cacheDir
updated, err = d.Update(newOpts)
if err != nil {
return err
}
@ -226,15 +221,10 @@ func Download(ctx context.Context, opts Options) (err error) {
return err
}
t, name, err := d.Download(ctx, Options{
Hash: opts.Hash,
HashAlgorithm: opts.HashAlgorithm,
Name: opts.Name,
URL: opts.URL,
Destination: cacheDir,
Progress: opts.Progress,
LocalDir: opts.LocalDir,
})
newOpts := opts
newOpts.Destination = cacheDir
t, name, err := d.Download(ctx, newOpts)
if err != nil {
return err
}