feat(*): dryRun/debug mode/mode plugins/googleapis

Signed-off-by: storyicon <yuanchao@bilibili.com>
This commit is contained in:
storyicon 2021-07-21 20:25:38 +08:00
parent 9aac714c32
commit da77c8086d
No known key found for this signature in database
GPG key ID: 245915D985F966CF
26 changed files with 730 additions and 126 deletions

View file

@ -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)