Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fly: add back upload/download progress
#3307 Signed-off-by: Joshua Winters <jwinters@pivotal.io>
- Loading branch information
Joshua Winters
committed
Mar 14, 2019
1 parent
9cd411f
commit d05a522
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
package executehelpers | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/concourse/concourse/go-concourse/concourse" | ||
"github.com/concourse/go-archive/tgzfs" | ||
) | ||
|
||
func Download(team concourse.Team, artifactID int, path string) error { | ||
pb := progress(path+":", os.Stdout) | ||
|
||
pb.Start() | ||
defer pb.Finish() | ||
|
||
out, err := team.GetArtifact(artifactID) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
defer out.Close() | ||
|
||
return tgzfs.Extract(out, path) | ||
return tgzfs.Extract(pb.NewProxyReader(out), path) | ||
} |
2 changes: 1 addition & 1 deletion
2
atc/exec/progress.go → ...mands/internal/executehelpers/progress.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package exec | ||
package executehelpers | ||
|
||
import ( | ||
"io" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters