github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/fly/commands/internal/executehelpers/downloads.go (about)

     1  package executehelpers
     2  
     3  import (
     4  	"github.com/pf-qiu/concourse/v6/go-concourse/concourse"
     5  	"github.com/concourse/go-archive/tgzfs"
     6  	"github.com/vbauerster/mpb/v4"
     7  )
     8  
     9  func Download(bar *mpb.Bar, team concourse.Team, artifactID int, path string) error {
    10  	out, err := team.GetArtifact(artifactID)
    11  	if err != nil {
    12  		return err
    13  	}
    14  
    15  	defer out.Close()
    16  
    17  	return tgzfs.Extract(bar.ProxyReader(out), path)
    18  }