diff --git a/internal/protocol/gemini/gemini.go b/internal/protocol/gemini/gemini.go index 6b6c604..5409fed 100644 --- a/internal/protocol/gemini/gemini.go +++ b/internal/protocol/gemini/gemini.go @@ -207,6 +207,16 @@ func (p *Protocol) downloadWithRedirects(ctx context.Context, req *core.Download // fresh downloads (create) and resume (append). When req.Writer is // set (caller manages the file), we use it as-is. if req.Output != "" && req.Output != "-" { + // Resume is meaningful only when we own the output file. If the + // caller already supplied a Writer we cannot append to Output + // behind their back, so disable resume to keep the partial-state + // sidecar consistent with what actually lands on disk. + if req.Resume && req.Writer != nil && req.Verbose { + fmt.Fprintf(os.Stderr, "[gemini] warning: --resume ignored because a Writer is set; output goes to the Writer only\n") + } + if req.Resume && req.Writer != nil { + req.Resume = false + } if req.Resume { canResume, resumeMeta, rerr := output.CanResume(req.Output, req.URL.String()) if rerr != nil {