mirror of
https://github.com/octoleo/restic.git
synced 2025-01-02 22:50:19 +00:00
Only show index progress bar if stdout is a terminal
This ensures that there is no interference when using restic for scripting use cases.
This commit is contained in:
parent
d6917c7e00
commit
54a4034ec0
@ -98,9 +98,9 @@ func printProgress(status string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newIndexProgress(quiet bool, json bool) *progress.Counter {
|
func newIndexProgress(quiet bool, json bool) *progress.Counter {
|
||||||
return newProgressMax(!quiet && !json, 0, "index files loaded")
|
return newProgressMax(!quiet && !json && stdoutIsTerminal(), 0, "index files loaded")
|
||||||
}
|
}
|
||||||
|
|
||||||
func newIndexTerminalProgress(quiet bool, json bool, term *termstatus.Terminal) *progress.Counter {
|
func newIndexTerminalProgress(quiet bool, json bool, term *termstatus.Terminal) *progress.Counter {
|
||||||
return newTerminalProgressMax(!quiet && !json, 0, "index files loaded", term)
|
return newTerminalProgressMax(!quiet && !json && stdoutIsTerminal(), 0, "index files loaded", term)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user