mirror of
https://github.com/TECHNOFAB11/powerproto.git
synced 2025-12-12 08:00:04 +01:00
feat(*): dryRun/debug mode/mode plugins/googleapis
Signed-off-by: storyicon <yuanchao@bilibili.com>
This commit is contained in:
parent
9aac714c32
commit
da77c8086d
26 changed files with 730 additions and 126 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/storyicon/powerproto/pkg/component/configmanager"
|
||||
"github.com/storyicon/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/storyicon/powerproto/pkg/configs"
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/storyicon/powerproto/pkg/util/progressbar"
|
||||
|
|
@ -31,6 +32,9 @@ import (
|
|||
func StepTidyConfig(ctx context.Context, targets []string) error {
|
||||
log := logger.NewDefault("tidy")
|
||||
log.SetLogLevel(logger.LevelError)
|
||||
if consts.IsDebugMode(ctx) {
|
||||
log.SetLogLevel(logger.LevelDebug)
|
||||
}
|
||||
|
||||
configManager, err := configmanager.NewConfigManager(log)
|
||||
if err != nil {
|
||||
|
|
@ -53,7 +57,7 @@ func StepTidyConfig(ctx context.Context, targets []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
progress := progressbar.GetProgressBar(len(configPaths))
|
||||
progress := progressbar.GetProgressBar(ctx, len(configPaths))
|
||||
progress.SetPrefix("tidy configs")
|
||||
for path := range configPaths {
|
||||
progress.SetSuffix(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue