fix scrolling progressbar bug
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ func startBar(size int64) *pb.ProgressBar {
|
||||
bar.ShowSpeed = true
|
||||
bar.Callback = func(s string) {
|
||||
// Colorize
|
||||
console.Info("\r" + s)
|
||||
console.Print("\r" + s)
|
||||
}
|
||||
// Feels like wget
|
||||
bar.Format("[=> ]")
|
||||
|
||||
+8
-13
@@ -37,15 +37,19 @@ var (
|
||||
// currTheme is current theme
|
||||
currThemeName = GetDefaultThemeName()
|
||||
|
||||
// Print prints a error message and exits
|
||||
Print = themesDB[currThemeName].Info.Print
|
||||
// Println prints a error message with a new line and exits
|
||||
Println = themesDB[currThemeName].Info.Println
|
||||
// Printf prints a error message with formatting and exits
|
||||
Printf = themesDB[currThemeName].Info.Printf
|
||||
|
||||
// Fatal prints a error message and exits
|
||||
Fatal = func(a ...interface{}) { print(themesDB[currThemeName].Fatal, a...); os.Exit(1) }
|
||||
// Fatalln prints a error message with a new line and exits
|
||||
Fatalln = func(a ...interface{}) { println(themesDB[currThemeName].Fatal, a...); os.Exit(1) }
|
||||
// Fatalf prints a error message with formatting and exits
|
||||
Fatalf = func(f string, a ...interface{}) {
|
||||
printf(themesDB[currThemeName].Fatal, f, a...)
|
||||
os.Exit(1)
|
||||
}
|
||||
Fatalf = func(f string, a ...interface{}) { printf(themesDB[currThemeName].Fatal, f, a...); os.Exit(1) }
|
||||
|
||||
// Error prints a error message
|
||||
Error = func(a ...interface{}) { print(themesDB[currThemeName].Error, a...) }
|
||||
@@ -122,11 +126,8 @@ var (
|
||||
mutex.Unlock()
|
||||
default:
|
||||
mutex.Lock()
|
||||
output := color.Output
|
||||
color.Output = os.Stderr
|
||||
c.Print(ProgramName() + ": ")
|
||||
c.Print(a...)
|
||||
color.Output = output
|
||||
mutex.Unlock()
|
||||
}
|
||||
}
|
||||
@@ -160,11 +161,8 @@ var (
|
||||
mutex.Unlock()
|
||||
default:
|
||||
mutex.Lock()
|
||||
output := color.Output
|
||||
color.Output = os.Stderr
|
||||
c.Print(ProgramName() + ": ")
|
||||
c.Println(a...)
|
||||
color.Output = output
|
||||
mutex.Unlock()
|
||||
}
|
||||
}
|
||||
@@ -198,11 +196,8 @@ var (
|
||||
mutex.Unlock()
|
||||
default:
|
||||
mutex.Lock()
|
||||
output := color.Output
|
||||
color.Output = os.Stderr
|
||||
c.Print(ProgramName() + ": ")
|
||||
c.Printf(f, a...)
|
||||
color.Output = output
|
||||
mutex.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user