This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will suppress all installation output except for errors encountered. The motivation is to use this flag when manager installs acorn because these interactive terminal messages aren't useful in that scenario. Signed-off-by: Craig Jellick <[email protected]>
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package term | ||
|
||
import ( | ||
"github.com/acorn-io/runtime/pkg/install/progress" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
type QuietBuilder struct { | ||
} | ||
|
||
func (b *QuietBuilder) New(msg string) progress.Progress { | ||
return newQuietSpinner(msg) | ||
} | ||
|
||
type quietSpinner struct { | ||
text string | ||
} | ||
|
||
func newQuietSpinner(text string) *quietSpinner { | ||
return &quietSpinner{ | ||
text: text, | ||
} | ||
} | ||
|
||
func (s *quietSpinner) Fail(err error) error { | ||
if err != nil { | ||
logrus.Errorf("Error encountered during '%v': %v", s.text, err) | ||
} | ||
return err | ||
} | ||
|
||
func (*quietSpinner) Infof(string, ...any) { | ||
// No-op, we're being quiet | ||
} | ||
|
||
func (*quietSpinner) SuccessWithWarning(string, ...any) { | ||
// No-op, we're being quiet | ||
} | ||
|
||
func (*quietSpinner) Success() { | ||
// No-op, we're being quiet | ||
} |