mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
Prevent progress bar if output is being piped
This commit is contained in:
parent
83726c76be
commit
493308abf9
1 changed files with 5 additions and 0 deletions
|
@ -40,6 +40,11 @@ struct ProgressState {
|
|||
}
|
||||
|
||||
func progress(state: ProgressState) {
|
||||
// Don't display the progress bar if we're not on a terminal
|
||||
if isatty(fileno(stdout)) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
let barLength = 60
|
||||
|
||||
let completeLength = Int(state.percentComplete * Float(barLength))
|
||||
|
|
Loading…
Reference in a new issue