print filename when downloading HARs with fetch command (#58)

Co-authored-by: Alex Haiut <alex@up9.com>
This commit is contained in:
Alex Haiut 2021-05-26 17:26:59 +03:00 committed by GitHub
parent 620f046a26
commit 38a364fae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,7 @@ func Unzip(reader *zip.Reader, dest string) error {
_ = os.MkdirAll(path, f.Mode())
} else {
_ = os.MkdirAll(filepath.Dir(path), f.Mode())
fmt.Print("writing HAR file [ ", path, " ] .. ")
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
if err != nil {
return err
@ -69,6 +70,7 @@ func Unzip(reader *zip.Reader, dest string) error {
if err := f.Close(); err != nil {
panic(err)
}
fmt.Println(" done")
}()
_, err = io.Copy(f, rc)