MCPcopy Index your code
hub / github.com/devspace-sh/devspace / initDownload

Method initDownload

pkg/devspace/sync/downstream.go:290–309  ·  view source on GitHub ↗
(download []*remote.Change)

Source from the content-addressed store, hash-verified

288}
289
290func (d *downstream) initDownload(download []*remote.Change) error {
291 reader, writer := io.Pipe()
292
293 defer reader.Close()
294 defer writer.Close()
295
296 errorChan := make(chan error)
297 go func() {
298 errorChan <- d.downloadFiles(writer, download)
299 }()
300
301 // Untaring all downloaded files to the right location
302 // this can be a lengthy process when we downloaded a lot of files
303 err := d.unarchiver.Untar(reader, d.sync.LocalPath)
304 if err != nil {
305 return errors.Wrap(err, "untar files")
306 }
307
308 return <-errorChan
309}
310
311// downloadFiles downloads the given files from the remote server and writes the contents into the given writer
312func (d *downstream) downloadFiles(writer io.WriteCloser, changes []*remote.Change) error {

Callers 1

applyChangesMethod · 0.95

Calls 3

downloadFilesMethod · 0.95
UntarMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected