Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar doesnt print if the last message is not a success #302

Closed
Vano2903 opened this issue Dec 22, 2021 · 3 comments · Fixed by #307
Closed

Progress bar doesnt print if the last message is not a success #302

Vano2903 opened this issue Dec 22, 2021 · 3 comments · Fixed by #307
Assignees
Labels
bug Something isn't working

Comments

@Vano2903
Copy link

I was trying to print a few logs but the last one was a warning, after the warning the function finished but the progress bar didn't print.

func installingPseudoList() {
    var pseudoProgramList = strings.Split("pseudo-excel pseudo-photoshop pseudo-chrome pseudo-outlook pseudo-explorer "+
	"pseudo-dops pseudo-git pseudo-vsc pseudo-intellij pseudo-asd pseudo-scoop pseudo-minecraft", " ")
	pterm.DefaultSection.Println("Installing pseudo programs")

	p, _ := pterm.DefaultProgressbar.WithTotal(len(pseudoProgramList)).WithTitle("Installing stuff").Start()
	for i := 0; i < p.Total; i++ {
		p.UpdateTitle("Installing " + pseudoProgramList[i])
		if pseudoProgramList[i] == "pseudo-minecraft" {
			pterm.Warning.Println("Could not install pseudo-minecraft\nThe company policy forbids games.")
		} else {
			pterm.Success.Println("Installing " + pseudoProgramList[i])
			p.Increment()
		}
		time.Sleep(time.Second / 2)
	}
	p.Stop()
}

If you run this function, since Minecraft is the last, the last log will be a warning which will lead to the progress bar not to print

@Vano2903 Vano2903 added the bug Something isn't working label Dec 22, 2021
@MarvinJWendt
Copy link
Member

Hi, thanks for the report! I'll take a look at this soon :)

@MarvinJWendt MarvinJWendt self-assigned this Jan 16, 2022
@create-issue-branch
Copy link

@MarvinJWendt
Copy link
Member

Hi @Vano2903, fixed! This will be in the release today :)
Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants