Skip to content

Commit

Permalink
Fixed encoded progress reporting for unzip
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstendb-ARM committed Sep 14, 2023
1 parent df6647f commit 7c097a3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cmd/installer/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,15 @@ func (p *PackType) install(installation *PacksInstallationType, checkEula bool)

if utils.GetEncodedProgress() {
encodedProgress = utils.NewEncodedProgress(int64(len(p.zipReader.File)), 0, p.path)
} else {
if interactiveTerminal && log.GetLevel() != log.ErrorLevel {
progress = progressbar.Default(int64(len(p.zipReader.File)), "I:")
}
} else if interactiveTerminal && log.GetLevel() != log.ErrorLevel {
progress = progressbar.Default(int64(len(p.zipReader.File)), "I:")
}

for _, file := range p.zipReader.File {
if interactiveTerminal && log.GetLevel() != log.ErrorLevel {
if utils.GetEncodedProgress() {
_ = encodedProgress.Add(1)
} else {
_ = progress.Add64(1)
}
if utils.GetEncodedProgress() {
_ = encodedProgress.Add(1)
} else if interactiveTerminal && log.GetLevel() != log.ErrorLevel {
_ = progress.Add64(1)
}
err = utils.SecureInflateFile(file, packHomeDir, p.Subfolder)
if err != nil {
Expand Down

0 comments on commit 7c097a3

Please sign in to comment.